brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 64b785c Raw
27 lines · cpp
1// RUN: %clang_cc1 -verify=omp61 -fopenmp -fopenmp-version=61 %s2 3void __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 'fp_nullify' or 'fb_preserve'}} // omp61-error{{expected 'match', 'adjust_args', or 'append_args' clause on 'omp declare variant' directive}}7void __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)11void __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)15void __attribute__((noinline)) host_entry_c(int *xp, int *&xpref, int n) {}16 17 18int 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}27