Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/metadirective-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-fdump-tree-gimple" } */
3
4 #define N 100
5
6 void
7 f (int x[], int y[], int z[])
8 {
9 int i;
10
11 #pragma omp target map(to: x, y) map(from: z) /* { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } } */
12 #pragma omp metadirective \
13 when (device={arch("nvptx")}: teams loop) \
14 default (parallel loop)
15 for (i = 0; i < N; i++)
16 z[i] = x[i] * y[i];
17 }
18
19 /* If offload device "nvptx" isn't supported, the front end can eliminate
20 that alternative and not produce a metadirective at all. Otherwise this
21 won't be resolved until late. */
22 /* { dg-final { scan-tree-dump-not "#pragma omp metadirective" "gimple" } } */
23 /* { dg-final { scan-tree-dump-not " teams" "gimple" { target { ! offload_nvptx } } } } */
24 /* { dg-final { scan-tree-dump "variant.\[0-9\]+ = \\\[omp_next_variant\\\] OMP_NEXT_VARIANT <0,\[\r\n \]+construct context = 14\[\r\n \]+1: device = \\{arch \\(.nvptx.\\)\\}\[\r\n \]+2: >;" "gimple" { target { offload_nvptx } } } } */