Debian Codegraph @

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

raw
1 /* { dg-do compile { target { c || c++11 } } } */
2 /* { dg-options "-fopenmp -std=c23" { target { c } } } */
3 /* { dg-additional-options "-fdump-tree-gimple" } */
4
5 #define N 100
6
7 void
8 f (int x[], int y[], int z[])
9 {
10 int i;
11
12 [[omp::sequence (directive (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 } } */
13 directive (metadirective
14 when (device={arch("nvptx")}: teams loop)
15 default (parallel loop)))]]
16 for (i = 0; i < N; i++)
17 z[i] = x[i] * y[i];
18 }
19
20 /* If offload device "nvptx" isn't supported, the front end can eliminate
21 that alternative and not produce a metadirective at all. Otherwise this
22 won't be resolved until late. */
23 /* { dg-final { scan-tree-dump-not "#pragma omp metadirective" "gimple" } } */
24 /* { dg-final { scan-tree-dump-not " teams" "gimple" { target { ! offload_nvptx } } } } */
25 /* { 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 } } } } */