Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / fortran / target-map-mix-imp-exp-common-block-members.f90
blob672630aec7d7ce758c87857f36b12a9fccaec724
1 ! Offloading test checking interaction of
2 ! mapping all the members of a common block
3 ! with a mix of explicit and implicit
4 ! mapping to a target region
5 ! REQUIRES: flang, amdgcn-amd-amdhsa
6 ! UNSUPPORTED: nvptx64-nvidia-cuda
7 ! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
8 ! UNSUPPORTED: aarch64-unknown-linux-gnu
9 ! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
10 ! UNSUPPORTED: x86_64-pc-linux-gnu
11 ! UNSUPPORTED: x86_64-pc-linux-gnu-LTO
13 ! RUN: %libomptarget-compile-fortran-run-and-check-generic
14 program main
15 implicit none
16 common /var_common/ var1, var2, var3
17 integer :: var1, var2, var3
19 call modify_1
21 !$omp target map(tofrom: var2)
22 var2 = var2 + var3
23 !$omp end target
25 call modify_2
27 print *, var1
28 print *, var2
29 print *, var3
30 end program
32 subroutine modify_1
33 common /var_common/ var1, var2, var3
34 integer :: var1, var2, var3
36 !$omp target map(tofrom: /var_common/)
37 var1 = 10
38 var2 = 20
39 var3 = 30
40 !$omp end target
41 end
43 subroutine modify_2
44 common /var_common/ var1, var2, var3
45 integer :: var1, var2, var3
46 integer :: copy
48 !$omp target map(tofrom: copy)
49 copy = var2 + var3
50 !$omp end target
52 print *, copy
53 end
55 !CHECK: 80
56 !CHECK: 10
57 !CHECK: 50
58 !CHECK: 30