1 // RUN: %clang_cc1 -internal-isystem %S/Inputs/include -x c -fopenmp -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-host.bc
2 // RUN: %clang_cc1 -internal-isystem %S/../../lib/Headers/openmp_wrappers -include __clang_openmp_device_functions.h -internal-isystem %S/../../lib/Headers/openmp_wrappers -internal-isystem %S/Inputs/include -x c -fopenmp -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - | FileCheck %s --check-prefixes=CHECK-C,CHECK
3 // RUN: %clang_cc1 -internal-isystem %S/Inputs/include -x c++ -fopenmp -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-host.bc
4 // RUN: %clang_cc1 -internal-isystem %S/../../lib/Headers/openmp_wrappers -include __clang_openmp_device_functions.h -internal-isystem %S/../../lib/Headers/openmp_wrappers -internal-isystem %S/Inputs/include -x c++ -fopenmp -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - | FileCheck %s --check-prefixes=CHECK-CPP,CHECK
12 void test_math_f64(double x
) {
13 // CHECK-LABEL: define {{.*}}test_math_f64
16 // CHECK: call double @__ocml_sin_f64
18 // CHECK: call double @__ocml_cos_f64
20 // CHECK: call double @llvm.fabs.f64
25 void test_math_f32(float x
) {
26 // CHECK-LABEL: define {{.*}}test_math_f32
29 // CHECK-C: call double @__ocml_sin_f64
30 // CHECK-CPP: call float @__ocml_sin_f32
32 // CHECK-C: call double @__ocml_cos_f64
33 // CHECK-CPP: call float @__ocml_cos_f32
35 // CHECK-C: call double @llvm.fabs.f64
36 // CHECK-CPP: call float @llvm.fabs.f32
40 void test_math_f32_suffix(float x
) {
41 // CHECK-LABEL: define {{.*}}test_math_f32_suffix
44 // CHECK: call float @__ocml_sin_f32
46 // CHECK: call float @__ocml_cos_f32
48 // CHECK: call float @llvm.fabs.f32