[win/asan] GetInstructionSize: Fix `83 E4 XX` to return 3. (#119644)
[llvm-project.git] / offload / test / offloading / fortran / target-map-all-common-block-members.f90
blob4e78ed1accf3ed57373ff68f8e0fe56357d19f3d
1 ! Offloading test checking interaction of mapping all the members of a common
2 ! block 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: var1, var2, var3)
20 var3 = var3 * 10
21 var2 = var2 * 10
22 var1 = var1 * 10
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
35 !$omp target map(tofrom: var2, var1, var3)
36 var3 = var3 + 40
37 var2 = var2 + 20
38 var1 = var1 + 30
39 !$omp end target
40 end
42 subroutine modify_2
43 common /var_common/ var1, var2, var3
44 integer :: var1, var2, var3
45 !$omp target map(tofrom: var2, var3, var1)
46 var3 = var3 + 20
47 var1 = var1 + 10
48 var2 = var2 + 15
49 !$omp end target
50 end
52 !CHECK: 310
53 !CHECK: 215
54 !CHECK: 420