]>
Commit | Line | Data |
---|---|---|
03be3cfe MV |
1 | #ifdef __cplusplus |
2 | extern "C" { | |
3 | #endif | |
4 | ||
5 | int omp_get_num_teams (void); | |
948d4619 | 6 | int bar (void); |
03be3cfe MV |
7 | |
8 | #ifdef __cplusplus | |
9 | } | |
10 | #endif | |
11 | ||
12 | /* { dg-do compile } */ | |
13 | ||
d0e4bdcd | 14 | #pragma omp requires reverse_offload |
03be3cfe MV |
15 | |
16 | void | |
17 | foo (void) | |
18 | { | |
19 | /* Ensure that no calls to OpenMP API runtime routines are allowed inside the | |
20 | corresponding target region. */ | |
21 | ||
22 | int a; | |
23 | ||
24 | #pragma omp target device (ancestor: 1) | |
25 | { | |
948d4619 | 26 | a = bar (); /* OK */ |
03be3cfe MV |
27 | a = omp_get_num_teams (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_teams\[^\n\r]*' in a region with 'device\\(ancestor\\)' clause" } */ |
28 | } | |
29 | ||
30 | #pragma omp target device (device_num: 1) | |
31 | { | |
32 | a = omp_get_num_teams (); | |
33 | } | |
34 | ||
35 | #pragma omp target device (1) | |
36 | { | |
37 | a = omp_get_num_teams (); | |
38 | } | |
39 | } |