Debian Codegraph @

clang/test/OpenMP/need_device_ptr_kind_ast_print.cpp

raw
1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=61 -ast-print %s \
2 // RUN: | FileCheck %s
3
4 // expected-no-diagnostics
5
6 void __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)
10 void __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)
14 void __attribute__((noinline)) host_entry_b(int *xp, int *&xpref, int n) {}
15
16 // CHECK-LABEL: int main()
17 int 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 }