Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / fortran / target-map-common-block.f90
blob8fcd504950515b7edb432dc41ece7f25fbc4ce74
1 ! Offloading test checking interaction of
2 ! mapping a full common block in a target
3 ! 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: /var_common/)
21 var1 = var1 + 20
22 var2 = var2 + 50
23 !$omp end target
25 call modify_2
27 print *, var1
28 print *, var2
29 end program
31 subroutine modify_1
32 common /var_common/ var1, var2
33 integer :: var1, var2
34 !$omp target map(tofrom: /var_common/)
35 var1 = var1 + 20
36 var2 = var2 + 30
37 !$omp end target
38 end
40 subroutine modify_2
41 common /var_common/ var1, var2
42 integer :: var1, var2
43 !$omp target map(tofrom: /var_common/)
44 var1 = var1 * 10
45 var2 = var2 * 10
46 !$omp end target
47 end
49 !CHECK: 400
50 !CHECK: 800