Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / fortran / target-map-second-common-block-member.f90
blob3aa937eb9adc6db780a9446305281aa9940c3f6e
1 ! Offloading test checking interaction of
2 ! mapping a member of a common block to a
3 ! target region
4 ! REQUIRES: flang, amdgcn-amd-amdhsa
5 ! UNSUPPORTED: nvptx64-nvidia-cuda
6 ! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
7 ! UNSUPPORTED: aarch64-unknown-linux-gnu
8 ! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
9 ! UNSUPPORTED: x86_64-pc-linux-gnu
10 ! UNSUPPORTED: x86_64-pc-linux-gnu-LTO
12 ! RUN: %libomptarget-compile-fortran-run-and-check-generic
13 program main
14 implicit none
15 common /var_common/ var1, var2
16 integer :: var1, var2
18 call modify_1
20 !$omp target map(tofrom: var2)
21 var2 = var2 + 20
22 !$omp end target
24 call modify_2
26 print *, var1
27 print *, var2
28 end program
30 subroutine modify_1
31 common /var_common/ var1, var2
32 integer :: var1, var2
33 !$omp target map(tofrom: var2)
34 var2 = var2 + 20
35 !$omp end target
36 end
38 subroutine modify_2
39 common /var_common/ var1, var2
40 integer :: var1, var2
41 !$omp target map(tofrom: var2)
42 var2 = var2 * 10
43 !$omp end target
44 end
46 !CHECK: 0
47 !CHECK: 400