1 // REQUIRES: amdgpu-registered-target 2 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-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 6 7 // device side declarations 8 #pragma omp declare target 9 extern "C" float cosf(float __x); 10 #pragma omp end declare target 11 12 // host side declaration 13 extern "C" float cosf(float __x); 14 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 19 __x = cosf(__x); 20 21 #pragma omp target 22 { 23 // cosf should not be treated as builtin on device 24 // CHECK-NOT: call float @llvm.cos.f32(float 25 __x = cosf(__x); 26 } 27 } 28