Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/target-device-ancestor-3.f90

raw
1 ! { dg-do compile }
2
3 ! This testcase ensure that no calls to OpenMP API runtime routines are allowed
4 ! inside the corresponding target region.
5
6 module my_omp_mod
7 use iso_c_binding
8 interface
9 integer function omp_get_thread_num ()
10 end
11 end interface
12 end
13
14 subroutine f1 ()
15 use my_omp_mod
16 implicit none
17 integer :: n
18
19 !$omp requires reverse_offload
20
21 !$omp target device (ancestor : 1)
22 n = omp_get_thread_num () ! { dg-error "OpenMP runtime API call 'omp_get_thread_num' in a region with 'device\\(ancestor\\)' clause" }
23 !$omp end target
24
25 !$omp target device (device_num : 1)
26 n = omp_get_thread_num ()
27 !$omp end target
28
29 !$omp target device (1)
30 n = omp_get_thread_num ()
31 !$omp end target
32
33 end