Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / fortran / target-map-all-common-block-members.f90
blobdef1e7c66307318d7f5808b9ac85cffcf262d9f2
1 ! Offloading test checking interaction of
2 ! mapping all the members of a common block
3 ! to a 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, var3
16 integer :: var1, var2, var3
18 call modify_1
20 !$omp target map(tofrom: var1, var2, var3)
21 var3 = var3 * 10
22 var2 = var2 * 10
23 var1 = var1 * 10
24 !$omp end target
26 call modify_2
28 print *, var1
29 print *, var2
30 print *, var3
31 end program
33 subroutine modify_1
34 common /var_common/ var1, var2, var3
35 integer :: var1, var2, var3
36 !$omp target map(tofrom: var2, var1, var3)
37 var3 = var3 + 40
38 var2 = var2 + 20
39 var1 = var1 + 30
40 !$omp end target
41 end
43 subroutine modify_2
44 common /var_common/ var1, var2, var3
45 integer :: var1, var2, var3
46 !$omp target map(tofrom: var2, var3, var1)
47 var3 = var3 + 20
48 var1 = var1 + 10
49 var2 = var2 + 15
50 !$omp end target
51 end
53 !CHECK: 310
54 !CHECK: 215
55 !CHECK: 420