1 // RUN: %clang_cc1 -verify -internal-isystem %S/Inputs/include -fopenmp -x c++ -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-x86-host.bc
2 // 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 amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -aux-triple x86_64-unknown-unknown -o - | FileCheck %s
3 // expected-no-diagnostics
8 // CHECK: define weak {{.*}} @__muldc3
9 // CHECK-DAG: call i32 @__ocml_isnan_f64(
10 // CHECK-DAG: call i32 @__ocml_isinf_f64(
12 // CHECK: define weak {{.*}} @__mulsc3
13 // CHECK-DAG: call i32 @__ocml_isnan_f32(
14 // CHECK-DAG: call i32 @__ocml_isinf_f32(
15 // CHECK-DAG: call float @__ocml_copysign_f32(
17 // CHECK: define weak {{.*}} @__divdc3
18 // CHECK-DAG: call i32 @__ocml_isnan_f64(
19 // CHECK-DAG: call i32 @__ocml_isinf_f64(
20 // CHECK-DAG: call i32 @__ocml_isfinite_f64(
21 // CHECK-DAG: call double @__ocml_copysign_f64(
22 // CHECK-DAG: call double @__ocml_scalbn_f64(
23 // CHECK-DAG: call double @__ocml_fabs_f64(
24 // CHECK-DAG: call double @__ocml_logb_f64(
26 // CHECK: define weak {{.*}} @__divsc3
27 // CHECK-DAG: call i32 @__ocml_isnan_f32(
28 // CHECK-DAG: call i32 @__ocml_isinf_f32(
29 // CHECK-DAG: call i32 @__ocml_isfinite_f32(
30 // CHECK-DAG: call float @__ocml_copysign_f32(
31 // CHECK-DAG: call float @__ocml_scalbn_f32(
32 // CHECK-DAG: call float @__ocml_fabs_f32(
33 // CHECK-DAG: call float @__ocml_logb_f32(
35 // We actually check that there are no declarations of non-OpenMP functions.
36 // That is, as long as we don't call an unkown function with a name that
37 // doesn't start with '__' we are good :)
39 // CHECK-NOT: declare.*@[^_]
41 void test_scmplx(std::complex<float> a
) {
48 void test_dcmplx(std::complex<double> a
) {
56 std::complex<T
> test_template_math_calls(std::complex<T
> a
) {
69 std::complex<float> test_scall(std::complex<float> a
) {
75 return test_template_math_calls(r
);
78 std::complex<double> test_dcall(std::complex<double> a
) {
84 return test_template_math_calls(r
);