1 // REQUIRES: nvptx-registered-target
2 // RUN: %clang_cc1 -internal-isystem %S/Inputs/include -fopenmp -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
3 // RUN: %clang_cc1 -internal-isystem %S/../../lib/Headers/openmp_wrappers -include __clang_openmp_device_functions.h -internal-isystem %S/Inputs/include -fopenmp -triple nvptx64-nvidia-cuda -aux-triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
7 // 6 calls to sin/cos(f), all translated to __nv_sin/__nv_cos calls:
11 // CHECK: call noundef double @__nv_sin(double
14 // CHECK: call noundef float @__nv_sinf(float
17 // CHECK: call noundef double @__nv_sin(double
20 // CHECK: call noundef double @__nv_cos(double
23 // CHECK: call noundef float @__nv_sinf(float
26 // CHECK: call noundef float @__nv_cosf(float
31 void test_sin_cos(T x
)
35 #pragma omp target map(from: res_sin, res_cos)
37 res_sin
= std::sin(x
);
38 res_cos
= std::cos(x
);
46 test_sin_cos
<double>(0.0);
47 test_sin_cos
<float>(0.0);