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 // 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
5 // 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
6 // expected-no-diagnostics
7
8 #ifdef __cplusplus
9 #include <complex>
10 #else
11 #include <complex.h>
12 #endif
13
14 // CHECK: define weak {{.*}} @__muldc3
15 // CHECK-DAG: call i32 @__nv_isnand(
16 // CHECK-DAG: call i32 @__nv_isinfd(
17 // CHECK-DAG: call double @__nv_copysign(
18
19 // CHECK: define weak {{.*}} @__mulsc3
20 // CHECK-DAG: call i32 @__nv_isnanf(
21 // CHECK-DAG: call i32 @__nv_isinff(
22 // CHECK-DAG: call float @__nv_copysignf(
23
24 // CHECK: define weak {{.*}} @__divdc3
25 // CHECK-DAG: call i32 @__nv_isnand(
26 // CHECK-DAG: call i32 @__nv_isinfd(
27 // CHECK-DAG: call i32 @__nv_isfinited(
28 // CHECK-DAG: call double @__nv_copysign(
29 // CHECK-DAG: call double @__nv_scalbn(
30 // CHECK-DAG: call double @__nv_fabs(
31 // CHECK-DAG: call double @__nv_logb(
32
33 // CHECK: define weak {{.*}} @__divsc3
34 // CHECK-DAG: call i32 @__nv_isnanf(
35 // CHECK-DAG: call i32 @__nv_isinff(
36 // CHECK-DAG: call i32 @__nv_finitef(
37 // CHECK-DAG: call float @__nv_copysignf(
38 // CHECK-DAG: call float @__nv_scalbnf(
39 // CHECK-DAG: call float @__nv_fabsf(
40 // CHECK-DAG: call float @__nv_logbf(
41
test_scmplx(float _Complex a)42 void test_scmplx(float _Complex a) {
43 #pragma omp target
44 {
45 (void)(a * (a / a));
46 }
47 }
48
test_dcmplx(double _Complex a)49 void test_dcmplx(double _Complex a) {
50 #pragma omp target
51 {
52 (void)(a * (a / a));
53 }
54 }
55