[rtsan] Add fork/execve interceptors (#117198)
[llvm-project.git] / offload / test / offloading / fortran / target-map-mix-imp-exp-common-block-members.f90
blob8c2907a87721db8fd1e893eab989e133f44e0b0f
1 ! Offloading test checking interaction of mapping all the members of a common
2 ! block with a mix of explicit and implicit mapping to a target region
3 ! REQUIRES: flang, amdgcn-amd-amdhsa
4 ! UNSUPPORTED: nvptx64-nvidia-cuda
5 ! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
6 ! UNSUPPORTED: aarch64-unknown-linux-gnu
7 ! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
8 ! UNSUPPORTED: x86_64-unknown-linux-gnu
9 ! UNSUPPORTED: x86_64-unknown-linux-gnu-LTO
11 ! RUN: %libomptarget-compile-fortran-run-and-check-generic
12 program main
13 implicit none
14 common /var_common/ var1, var2, var3
15 integer :: var1, var2, var3
17 call modify_1
19 !$omp target map(tofrom: var2)
20 var2 = var2 + var3
21 !$omp end target
23 call modify_2
25 print *, var1
26 print *, var2
27 print *, var3
28 end program
30 subroutine modify_1
31 common /var_common/ var1, var2, var3
32 integer :: var1, var2, var3
34 !$omp target map(tofrom: /var_common/)
35 var1 = 10
36 var2 = 20
37 var3 = 30
38 !$omp end target
39 end
41 subroutine modify_2
42 common /var_common/ var1, var2, var3
43 integer :: var1, var2, var3
44 integer :: copy
46 !$omp target map(tofrom: copy)
47 copy = var2 + var3
48 !$omp end target
50 print *, copy
51 end
53 !CHECK: 80
54 !CHECK: 10
55 !CHECK: 50
56 !CHECK: 30