| 1 |
/* Test parsing of #pragma omp declare variant */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
|
| 4 |
int fn0 (int); |
| 5 |
int fn6 (int); |
| 6 |
|
| 7 |
#pragma omp declare variant (fn0) match (user={condition(0)}) |
| 8 |
int a; /* { dg-error "not immediately followed by a function declaration or definition" } */ |
| 9 |
|
| 10 |
#pragma omp declare variant (fn0) match (user={condition(0)}) |
| 11 |
int fn1 (int a), fn2 (int a); /* { dg-error "not immediately followed by a single function declaration or definition" } */ |
| 12 |
|
| 13 |
#pragma omp declare variant (fn0) match (user={condition(0)}) |
| 14 |
int b, fn3 (int a); /* { dg-error "not immediately followed by a function declaration or definition" } */ |
| 15 |
|
| 16 |
#pragma omp declare variant (fn0) match (user={condition(0)}) |
| 17 |
int fn4 (int a), c; /* { dg-error "not immediately followed by a function declaration or definition" } */ |
| 18 |
|
| 19 |
int t; |
| 20 |
|
| 21 |
#pragma omp declare variant (fn0) match (user={condition(0)}) |
| 22 |
#pragma omp declare variant (fn6) match (implementation={vendor(unknown)}) |
| 23 |
#pragma omp threadprivate(t) /* { dg-error "must be followed by function declaration or definition or another" } */ |
| 24 |
int fn5 (int a); |
| 25 |
|
| 26 |
#pragma omp declare variant (1 + 2) match (user={condition(0)}) /* { dg-error "expected identifier before numeric constant" } */ |
| 27 |
int fn7 (int); |
| 28 |
|
| 29 |
#pragma omp declare variant (t) match (user={condition(0)}) /* { dg-error "variant 't' is not a function" } */ |
| 30 |
int fn8 (int); |
| 31 |
|
| 32 |
long fn9 (char, short); |
| 33 |
|
| 34 |
#pragma omp declare variant (fn9) match (implementation={vendor(unknown)}) /* { dg-error "variant 'fn9' and base 'fn10' have incompatible types" } */ |
| 35 |
int fn10 (int, long long); |
| 36 |
|
| 37 |
#pragma omp declare variant (memcpy) match (implementation={vendor(llvm)}) /* { dg-error "'memcpy' undeclared here" } */ |
| 38 |
void *fn11 (void *, const void *, __SIZE_TYPE__); |
| 39 |
|
| 40 |
#pragma omp declare variant (__builtin_memmove) match (implementation={vendor(gnu)}) /* { dg-error "variant '__builtin_memmove' is a built-in" } */ |
| 41 |
void *fn12 (void *, const void *, __SIZE_TYPE__); |