1 // REQUIRES: amdgpu-registered-target
3 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-ppc-host.bc
4 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
5 // RUN: llvm-dis < %t-ppc-host.bc | FileCheck %s -check-prefix=HOST
7 // device side declarations
8 #pragma omp declare target
9 extern "C" float cosf(float __x
);
10 #pragma omp end declare target
12 // host side declaration
13 extern "C" float cosf(float __x
);
15 void test_amdgcn_openmp_device(float __x
) {
16 // the default case where predefined library functions are treated as
17 // builtins on the host
18 // HOST: call float @llvm.cos.f32(float
23 // cosf should not be treated as builtin on device
24 // CHECK-NOT: call float @llvm.cos.f32(float