| 1 |
/* The following definitions are in omp_lib, which cannot be included |
| 2 |
in gcc/testsuite/ */ |
| 3 |
|
| 4 |
#if __cplusplus >= 201103L |
| 5 |
# define __GOMP_UINTPTR_T_ENUM : __UINTPTR_TYPE__ |
| 6 |
#else |
| 7 |
# define __GOMP_UINTPTR_T_ENUM |
| 8 |
#endif |
| 9 |
|
| 10 |
typedef enum omp_interop_t __GOMP_UINTPTR_T_ENUM |
| 11 |
{ |
| 12 |
omp_interop_none = 0, |
| 13 |
__omp_interop_t_max__ = __UINTPTR_MAX__ |
| 14 |
} omp_interop_t; |
| 15 |
|
| 16 |
|
| 17 |
void repl1(); |
| 18 |
#pragma omp declare variant(repl1) match(construct={dispatch}) |
| 19 |
void base1(); |
| 20 |
|
| 21 |
void |
| 22 |
test () |
| 23 |
{ |
| 24 |
const omp_interop_t obj1 = omp_interop_none; |
| 25 |
omp_interop_t obj2[2]; |
| 26 |
const omp_interop_t *obj3; |
| 27 |
short x; |
| 28 |
|
| 29 |
#pragma omp dispatch interop ( obj1, obj2, obj1 ) device(2) /* { dg-error "'obj2' must be of 'omp_interop_t'" } */ |
| 30 |
base1 (); |
| 31 |
/* { dg-error "number of list items in 'interop' clause \\(3\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'repl1'" "" { target c } .-2 } */ |
| 32 |
/* { dg-error "number of list items in 'interop' clause \\(3\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'void repl1\\(\\)'" "" { target c++ } .-3 } */ |
| 33 |
|
| 34 |
#pragma omp dispatch interop ( obj3 ) /* { dg-error "'obj3' must be of 'omp_interop_t'" } */ |
| 35 |
base1 (); |
| 36 |
/* { dg-error "number of list items in 'interop' clause \\(1\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'repl1'" "" { target c } .-2 } */ |
| 37 |
/* { dg-error "number of list items in 'interop' clause \\(1\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'void repl1\\(\\)'" "" { target c++ } .-3 } */ |
| 38 |
|
| 39 |
#pragma omp dispatch interop ( obj1 ) |
| 40 |
base1 (); |
| 41 |
/* { dg-error "number of list items in 'interop' clause \\(1\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'repl1'" "" { target c } .-2 } */ |
| 42 |
/* { dg-error "number of list items in 'interop' clause \\(1\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'void repl1\\(\\)'" "" { target c++ } .-3 } */ |
| 43 |
|
| 44 |
#pragma omp dispatch interop ( obj2 ) /* { dg-error "'obj2' must be of 'omp_interop_t'" } */ |
| 45 |
base1 (); |
| 46 |
/* { dg-error "number of list items in 'interop' clause \\(1\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'repl1'" "" { target c } .-2 } */ |
| 47 |
/* { dg-error "number of list items in 'interop' clause \\(1\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'void repl1\\(\\)'" "" { target c++ } .-3 } */ |
| 48 |
|
| 49 |
#pragma omp dispatch interop ( x ) /* { dg-error "'x' must be of 'omp_interop_t'" } */ |
| 50 |
base1 (); |
| 51 |
/* { dg-error "number of list items in 'interop' clause \\(1\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'repl1'" "" { target c } .-2 } */ |
| 52 |
/* { dg-error "number of list items in 'interop' clause \\(1\\) exceeds the number of 'append_args' items \\(0\\) for 'declare variant' candidate 'void repl1\\(\\)'" "" { target c++ } .-3 } */ |
| 53 |
} |