Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fopenmp -std=c23" } */
3
4 int i;
5 int t1, t2, t3, t4, t5, t6, t7;
6
7 void
8 foo ()
9 {
10 [[omp::directive]]; /* { dg-error "'omp::directive' attribute requires argument" } */
11 [[omp::directive ()]]; /* { dg-error "expected OpenMP directive name" } */
12 [[omp::directive (nonexistent foobar)]]; /* { dg-error "unknown OpenMP directive name in 'omp::directive' attribute argument" } */
13 [[omp::sequence]]; /* { dg-error "'omp::sequence' attribute requires argument" } */
14 [[omp::sequence()]]; /* { dg-error "expected 'directive' or 'sequence'" } */
15 [[omp::sequence(foobar())]]; /* { dg-error "expected 'directive' or 'sequence'" } */
16 [[omp::sequence(omp::foobar())]]; /* { dg-error "expected 'directive' or 'sequence'" } */
17 [[omp::sequence(directive(taskwait), foobar())]]; /* { dg-error "expected 'directive' or 'sequence'" } */
18 [[omp::sequence(omp::directive(taskwait), omp::foobar())]]; /* { dg-error "expected 'directive' or 'sequence'" } */
19 [[omp::sequence(directive(taskwait) foobar())]]; /* { dg-error "expected '\\\)' before 'foobar'" } */
20 [[omp::sequence(directive)]]; /* { dg-error "expected '\\\(' before '\\\)' token" } */
21 [[omp::sequence(omp::sequence)]]; /* { dg-error "expected '\\\(' before '\\\)' token" } */
22 [[omp::directive (parallel), omp::directive (single)]] /* { dg-error "OpenMP construct among 'omp::directive' attributes requires all 'omp::directive' attributes on the same statement to be in the same 'omp::sequence'" } */
23 ;
24 [[omp::directive (parallel)]] /* { dg-error "OpenMP construct among 'omp::directive' attributes requires all 'omp::directive' attributes on the same statement to be in the same 'omp::sequence'" } */
25 [[omp::directive (single)]]
26 ;
27 [[omp::directive (taskwait), omp::directive (taskyield)]] /* { dg-error "multiple OpenMP standalone directives among 'omp::directive' attributes must be all within the same 'omp::sequence'" } */
28 ;
29 [[omp::directive (taskwait)]]
30 [[omp::directive (taskyield)]] /* { dg-error "multiple OpenMP standalone directives among 'omp::directive' attributes must be all within the same 'omp::sequence'" } */
31 ;
32 [[omp::directive (flush)]] /* { dg-error "standalone OpenMP directives in 'omp::directive' attribute can only appear on an empty statement" } */
33 i++;
34 int [[omp::directive (threadprivate (t2))]] b; /* { dg-warning "'omp::directive' scoped attribute directive ignored" } */
35 int *[[omp::directive (threadprivate (t3))]] c; /* { dg-warning "'omp::directive' scoped attribute directive ignored" } */
36 typedef int T [[omp::directive (threadprivate (t5))]]; /* { dg-error "'omp::directive' not allowed to be specified in this context" } */
37 int e[10] [[omp::directive (threadprivate (t6))]]; /* { dg-warning "'omp::directive' scoped attribute directive ignored" } */
38 struct [[omp::directive (threadprivate (t7))]] S {}; /* { dg-warning "'omp::directive' scoped attribute directive ignored" } */
39 }