| 1 |
// RUN: %clang_cc1 -verify=omp61 -fopenmp -fopenmp-version=61 %s |
| 2 |
|
| 3 |
void __attribute__((noinline)) device_impl(int *xp, int *&xpref, int n) {} |
| 4 |
|
| 5 |
#pragma omp declare variant(device_impl) \ |
| 6 |
adjust_args(need_device_ptr(foo) : xp, xpref) // omp61-error{{invalid argument for 'need_device_ptr' kind in 'adjust_args' clause; expected 'fb_nullify' or 'fb_preserve'}} // omp61-error{{expected 'match', 'adjust_args', or 'append_args' clause on 'omp declare variant' directive}} |
| 7 |
void __attribute__((noinline)) host_entry_a(int *xp, int *&xpref, int n) {} |
| 8 |
|
| 9 |
#pragma omp declare variant(device_impl) \ |
| 10 |
adjust_args(need_device_ptr(fb_nullify) : xp, xpref) |
| 11 |
void __attribute__((noinline)) host_entry_b(int *xp, int *&xpref, int n) {} |
| 12 |
|
| 13 |
#pragma omp declare variant(device_impl) \ |
| 14 |
adjust_args(need_device_ptr(fb_preserve) : xp, xpref) |
| 15 |
void __attribute__((noinline)) host_entry_c(int *xp, int *&xpref, int n) {} |
| 16 |
|
| 17 |
|
| 18 |
int main() { |
| 19 |
int x; |
| 20 |
int *xp = &x; |
| 21 |
|
| 22 |
host_entry_a(xp, xp, 1); |
| 23 |
host_entry_b(xp, xp, 1); |
| 24 |
host_entry_c(xp, xp, 1); |
| 25 |
return 0; |
| 26 |
} |