| 1 |
/* Test parsing of #pragma omp declare variant */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-std=c17 -fopenmp -pedantic-errors" } */ |
| 4 |
|
| 5 |
int f0 (int, int *, int); |
| 6 |
|
| 7 |
int |
| 8 |
f1 (int x) |
| 9 |
{ |
| 10 |
if (x) |
| 11 |
#pragma omp declare variant (fn0) match (user={condition(0)}) |
| 12 |
extern int f3 (int a, int *b, int c); /* { dg-error "must be followed by function declaration or definition" } */ |
| 13 |
while (x < 10) |
| 14 |
#pragma omp declare variant (fn0) match (user={condition(0)}) |
| 15 |
extern int f4 (int a, int *b, int c); /* { dg-error "must be followed by function declaration or definition" } */ |
| 16 |
{ |
| 17 |
lab: |
| 18 |
#pragma omp declare variant (fn0) match (user={condition(0)}) |
| 19 |
extern int f5 (int a, int *b, int c); /* { dg-error "must be followed by function declaration or definition" } */ |
| 20 |
x++; |
| 21 |
} |
| 22 |
return x; |
| 23 |
} |