| 1 |
/* Test parsing of #pragma omp declare simd */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
|
| 4 |
#pragma omp declare simd |
| 5 |
int a; /* { dg-error "not immediately followed by a function declaration or definition" } */ |
| 6 |
|
| 7 |
#pragma omp declare simd |
| 8 |
int fn1 (int a), fn2 (int a); /* { dg-error "not immediately followed by a single function declaration or definition" } */ |
| 9 |
|
| 10 |
#pragma omp declare simd |
| 11 |
int b, fn3 (int a); /* { dg-error "not immediately followed by a function declaration or definition" } */ |
| 12 |
|
| 13 |
#pragma omp declare simd linear (a) |
| 14 |
int fn4 (int a), c; /* { dg-error "not immediately followed by a function declaration or definition" } */ |
| 15 |
|
| 16 |
int t; |
| 17 |
|
| 18 |
#pragma omp declare simd |
| 19 |
#pragma omp declare simd |
| 20 |
#pragma omp threadprivate(t) /* { dg-error "must be followed by function declaration or definition or another" } */ |
| 21 |
int fn5 (int a); |
| 22 |
|
| 23 |
#pragma omp declare simd inbranch notinbranch /* { dg-error "clause is incompatible with" } */ |
| 24 |
int fn6 (int); |
| 25 |
|
| 26 |
#pragma omp declare simd aligned (a, b) |
| 27 |
int fn7 (int *a, int b[64]); |
| 28 |
|
| 29 |
#pragma omp declare simd aligned (a) /* { dg-error "neither a pointer nor an array" } */ |
| 30 |
int fn8 (int a); |
| 31 |
|
| 32 |
#pragma omp declare simd aligned (c) /* { dg-error "neither a pointer nor an array" } */ |
| 33 |
int fn9 (float c); |
| 34 |
|
| 35 |
#pragma omp declare simd aligned (d) /* { dg-error "neither a pointer nor an array" } */ |
| 36 |
int fn10 (double d); |
| 37 |
|
| 38 |
struct D { int d; }; |
| 39 |
|
| 40 |
#pragma omp declare simd aligned (e) /* { dg-error "neither a pointer nor an array" } */ |
| 41 |
int fn11 (struct D e); |
| 42 |
|
| 43 |
#pragma omp declare simd linear(a:7) uniform(a) /* { dg-error "appears more than once" } */ |
| 44 |
int f12 (int a); |
| 45 |
#pragma omp declare simd linear(a) linear(a) /* { dg-error "appears more than once" } */ |
| 46 |
int f13 (int a); |
| 47 |
#pragma omp declare simd linear(a) linear(a:7) /* { dg-error "appears more than once" } */ |
| 48 |
int f14 (int a); |
| 49 |
#pragma omp declare simd linear(a:6) linear(a:6)/* { dg-error "appears more than once" } */ |
| 50 |
int f15 (int a); |
| 51 |
#pragma omp declare simd uniform(a) uniform(a) /* { dg-error "appears more than once" } */ |
| 52 |
int f16 (int a); |
| 53 |
#pragma omp declare simd uniform(a) aligned (a: 32) |
| 54 |
int f17 (int *a); |