Fix gcc.c-torture/execute/ieee/cdivchkf.c on hpux
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / reverse-offload-6.f90
blobddb7008cb1ad3f07a4b0ca2024209adc232d093e
2 ! Ensure that a mapping with no argument works
5 ! { dg-additional-options -foffload-options=nvptx-none=-misa=sm_35 { target offload_target_nvptx } }
7 module m
8 implicit none (type, external)
9 integer :: x = 32
10 integer :: dev_num2 = -1
11 contains
12 subroutine foo()
13 use omp_lib, only: omp_get_device_num
14 x = x + 10
15 dev_num2 = omp_get_device_num()
16 end
17 end module m
19 use m
20 use omp_lib
21 !$omp requires reverse_offload
22 implicit none (type, external)
23 integer :: dev_num = -1
24 !$omp target map(from:dev_num)
25 dev_num = omp_get_device_num()
26 ! This calls GOMP_target_ext with number of maps = 0
27 !$omp target device(ancestor:1)
28 call foo
29 !$omp end target
30 !$omp end target
32 if (omp_get_num_devices() > 0 .and. dev_num2 == dev_num) stop 1
33 if (x /= 42) stop 2
34 end