Debian Codegraph @

clang/test/OpenMP/constexpr_capture.cpp

raw
1 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-linux -emit-llvm %s -o - -std=c++11 2>&1 | FileCheck %s
2 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fopenmp-targets=x86_64-pc-linux-gnu -triple powerpc64le-unknown-linux -emit-llvm %s -o - -std=c++11 2>&1 | FileCheck %s
3 // expected-no-diagnostics
4
5 template <int __v> struct integral_constant {
6 static constexpr int value = __v;
7 };
8
9 template <typename _Tp, int v = 0, bool _IsArray = integral_constant<v>::value>
10 struct decay {
11 typedef int type;
12 };
13 struct V {
14 template <typename TArg0 = int, typename = typename decay<TArg0>::type> V();
15 };
16
17 constexpr double h_chebyshev_coefs[] = {
18 1.0000020784639703, 0.0021491446496202074};
19
20 void test(double *d_value)
21 {
22 #pragma omp target map(tofrom \
23 : d_value [0:1]) map(always, to \
24 : h_chebyshev_coefs [0:2])
25 *d_value = h_chebyshev_coefs[1]; return;
26 }
27
28 // CHECK: void @__omp_offloading_{{.+}}test{{.+}}(ptr %0)
29
30 int main() {
31 #pragma omp target
32 V v;
33 return 0;
34 }
35
36 // CHECK: call void @__omp_offloading_{{.+}}_main_{{.+}}()