1 // REQUIRES: nvptx-registered-target
2 // RUN: %clang_cc1 -verify -internal-isystem %S/Inputs/include -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
3 // RUN: %clang_cc1 -verify -internal-isystem %S/../../lib/Headers/openmp_wrappers -include __clang_openmp_device_functions.h -internal-isystem %S/Inputs/include -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -aux-triple powerpc64le-unknown-unknown -o - | FileCheck %s
4 // expected-no-diagnostics
9 // CHECK: define weak {{.*}} @__muldc3
10 // CHECK-DAG: call i32 @__nv_isnand(
11 // CHECK-DAG: call i32 @__nv_isinfd(
12 // CHECK-DAG: call double @__nv_copysign(
14 // CHECK: define weak {{.*}} @__mulsc3
15 // CHECK-DAG: call i32 @__nv_isnanf(
16 // CHECK-DAG: call i32 @__nv_isinff(
17 // CHECK-DAG: call float @__nv_copysignf(
19 // CHECK: define weak {{.*}} @__divdc3
20 // CHECK-DAG: call i32 @__nv_isnand(
21 // CHECK-DAG: call i32 @__nv_isinfd(
22 // CHECK-DAG: call i32 @__nv_isfinited(
23 // CHECK-DAG: call double @__nv_copysign(
24 // CHECK-DAG: call double @__nv_scalbn(
25 // CHECK-DAG: call double @__nv_fabs(
26 // CHECK-DAG: call double @__nv_logb(
28 // CHECK: define weak {{.*}} @__divsc3
29 // CHECK-DAG: call i32 @__nv_isnanf(
30 // CHECK-DAG: call i32 @__nv_isinff(
31 // CHECK-DAG: call i32 @__nv_finitef(
32 // CHECK-DAG: call float @__nv_copysignf(
33 // CHECK-DAG: call float @__nv_scalbnf(
34 // CHECK-DAG: call float @__nv_fabsf(
35 // CHECK-DAG: call float @__nv_logbf(
37 // We actually check that there are no declarations of non-OpenMP functions.
38 // That is, as long as we don't call an unkown function with a name that
39 // doesn't start with '__' we are good :)
41 // CHECK-NOT: declare.*@[^_]
43 void test_scmplx(std::complex<float> a
) {
50 void test_dcmplx(std::complex<double> a
) {
58 std::complex<T
> test_template_math_calls(std::complex<T
> a
) {
71 std::complex<float> test_scall(std::complex<float> a
) {
77 return test_template_math_calls(r
);
80 std::complex<double> test_dcall(std::complex<double> a
) {
86 return test_template_math_calls(r
);