Debian Codegraph @

gcc/testsuite/gcc.dg/gomp/attrs-21.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fopenmp -std=c23" } */
3
4 void
5 foo ()
6 {
7 [[omp::decl]] int v1; /* { dg-error "'omp::decl' attribute requires argument" } */
8 [[omp::decl ()]] int v2; /* { dg-error "expected OpenMP directive name" } */
9 /* { dg-error "'omp::directive' not allowed to be specified in this context" "" { target *-*-* } .-1 } */
10 [[omp::decl (nonexistent foobar)]] int v3; /* { dg-error "unknown OpenMP directive name in 'omp::decl' attribute argument" } */
11 /* { dg-error "'omp::directive' not allowed to be specified in this context" "" { target *-*-* } .-1 } */
12 [[omp::sequence(decl(threadprivate))]] int v4; /* { dg-error "expected 'directive' or 'sequence'" } */
13 /* { dg-error "'omp::directive' not allowed to be specified in this context" "" { target *-*-* } .-1 } */
14 [[omp::sequence(omp::decl(threadprivate))]] int v5; /* { dg-error "expected 'directive' or 'sequence'" } */
15 /* { dg-error "'omp::directive' not allowed to be specified in this context" "" { target *-*-* } .-1 } */
16 [[omp::decl (barrier)]]; /* { dg-error "OpenMP 'omp::decl' attribute on a statement" } */
17 [[omp::decl (parallel)]] {}; /* { dg-error "OpenMP 'omp::decl' attribute on a statement" } */
18 extern int [[omp::decl (threadprivate)]] *v6; /* { dg-warning "'omp::directive' scoped attribute directive ignored" } */
19 [[omp::decl (threadprivate (v5))]] static int v7; /* { dg-error "expected end of line before '\\\(' token" } */
20 extern int v8;
21 [[omp::decl (declare target (v8))]] static int v9; /* { dg-error "expected end of line before '\\\(' token" } */
22 [[omp::decl (declare target enter (v8))]] static int v10; /* { dg-error "expected an OpenMP clause before '\\\(' token" } */
23 [[omp::decl (declare target, link (v9))]] static int v11; /* { dg-error "expected an OpenMP clause before '\\\(' token" } */
24 [[omp::decl (declare target device_type (any))]] static int v12; /* { dg-error "directive with only 'device_type' or 'indirect' clauses" } */
25 }
26
27 int i;
28 [[omp::decl (assume (i < 42))]]; /* { dg-error "OpenMP 'omp::decl' attribute on a statement" } */