Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/target-device-ancestor-5.c

raw
1 #pragma omp requires reverse_offload
2
3 void
4 foo ()
5 {
6 /* Good nesting - as reverse offload */
7 #pragma omp target
8 #pragma omp target device(ancestor:1) /* valid -> no warning */ /* { dg-bogus "'target' construct inside of 'target' region" } */
9 { }
10
11 /* Bad nesting */
12 #pragma omp target
13 #pragma omp target /* { dg-warning "'target' construct inside of 'target' region" } */
14 #pragma omp target /* { dg-warning "'target' construct inside of 'target' region" } */
15 { }
16
17 /* Good nesting - as reverse offload */
18 #pragma omp target
19 #pragma omp target /* { dg-warning "'target' construct inside of 'target' region" } */
20 #pragma omp target device(ancestor:1) /* valid -> no warning */ /* { dg-bogus "'target' construct inside of 'target' region" } */
21 { }
22
23 #pragma omp target
24 #pragma omp target device(ancestor:1) /* valid -> no warning */ /* { dg-bogus "'target' construct inside of 'target' region" } */
25 #pragma omp target device(ancestor:1) /* { dg-error "OpenMP constructs are not allowed in target region with 'ancestor'" } */
26 { }
27
28 }