25 lines · cpp
1// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=61 -ast-print %s \2// RUN: | FileCheck %s3 4// expected-no-diagnostics5 6void __attribute__((noinline)) device_impl(int *xp, int *&xpref, int n) {}7 8#pragma omp declare variant(device_impl) \9 adjust_args(need_device_ptr(fb_nullify) : xp, xpref)10void __attribute__((noinline)) host_entry_a(int *xp, int *&xpref, int n) {}11 12#pragma omp declare variant(device_impl) \13 adjust_args(need_device_ptr(fb_preserve) : xp, xpref)14void __attribute__((noinline)) host_entry_b(int *xp, int *&xpref, int n) {}15 16// CHECK-LABEL: int main()17int main() {18 int x;19 int *xp = &x;20 21 host_entry_a(xp, xp, 1);22 host_entry_b(xp, xp, 1);23 return 0;24}25