]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/c-c++-common/gomp/target-device-ancestor-3.c
Merge branch 'master' into devel/modula-2.
[gcc.git] / gcc / testsuite / c-c++-common / gomp / target-device-ancestor-3.c
CommitLineData
03be3cfe
MV
1#ifdef __cplusplus
2extern "C" {
3#endif
4
5int omp_get_num_teams (void);
948d4619 6int 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
16void
17foo (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}
This page took 0.276895 seconds and 5 git commands to generate.