37 lines · cpp
1// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-linux -emit-llvm %s -o - -std=c++11 2>&1 | FileCheck %s2// 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 %s3// expected-no-diagnostics4 5template <int __v> struct integral_constant {6 static constexpr int value = __v;7};8 9template <typename _Tp, int v = 0, bool _IsArray = integral_constant<v>::value>10struct decay {11 typedef int type;12};13struct V {14 template <typename TArg0 = int, typename = typename decay<TArg0>::type> V();15};16 17constexpr double h_chebyshev_coefs[] = {18 1.0000020784639703, 0.0021491446496202074};19 20void 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 30int main() {31#pragma omp target32 V v;33 return 0;34}35 36// CHECK: call void @__omp_offloading_{{.+}}_main_{{.+}}()37