Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/pr118579.c

raw
1 /* { dg-do compile } */
2
3 /* Make sure errors in variable-lists are diagnosed in the right place. */
4
5 void fvar(int *, int *);
6 #pragma omp declare variant(fvar) \
7 match(construct={dispatch}) \
8 adjust_args(need_device_ptr: yyy, xxx, xxx)
9 /* { dg-error "37: .xxx. is specified more than once" "" { target *-*-* } .-1 } */
10 void f(int *xxx, int*yyy);
11
12
13 extern void frobnicate (int);
14 void g (int x, int y)
15 {
16 int l = x + y;
17 static int s = 42;
18 frobnicate (s);
19 #pragma omp threadprivate (l, s)
20 /* { dg-error "28: automatic variable .l. cannot be .threadprivate." "" { target *-*-* } .-1 } */
21 /* { dg-error "31: .s. declared .threadprivate. after first use" "" { target *-*-* } .-2 } */
22 {
23 f (&l, &s);
24 }
25 }