[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Headers / nvptx_device_math_complex.c
blobf7b476f8d55e738bafa71ffce51f6a60e2b9b288
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
8 #ifdef __cplusplus
9 #include <complex>
10 #else
11 #include <complex.h>
12 #endif
14 // CHECK: define weak {{.*}} @__divsc3
15 // CHECK-DAG: call i32 @__nv_isnanf(
16 // CHECK-DAG: call i32 @__nv_isinff(
17 // CHECK-DAG: call i32 @__nv_finitef(
18 // CHECK-DAG: call float @__nv_copysignf(
19 // CHECK-DAG: call float @__nv_scalbnf(
20 // CHECK-DAG: call float @__nv_fabsf(
21 // CHECK-DAG: call float @__nv_logbf(
23 // CHECK: define weak {{.*}} @__mulsc3
24 // CHECK-DAG: call i32 @__nv_isnanf(
25 // CHECK-DAG: call i32 @__nv_isinff(
26 // CHECK-DAG: call float @__nv_copysignf(
28 // CHECK: define weak {{.*}} @__divdc3
29 // CHECK-DAG: call i32 @__nv_isnand(
30 // CHECK-DAG: call i32 @__nv_isinfd(
31 // CHECK-DAG: call i32 @__nv_isfinited(
32 // CHECK-DAG: call double @__nv_copysign(
33 // CHECK-DAG: call double @__nv_scalbn(
34 // CHECK-DAG: call double @__nv_fabs(
35 // CHECK-DAG: call double @__nv_logb(
37 // CHECK: define weak {{.*}} @__muldc3
38 // CHECK-DAG: call i32 @__nv_isnand(
39 // CHECK-DAG: call i32 @__nv_isinfd(
40 // CHECK-DAG: call double @__nv_copysign(
42 void test_scmplx(float _Complex a) {
43 #pragma omp target
45 (void)(a * (a / a));
49 void test_dcmplx(double _Complex a) {
50 #pragma omp target
52 (void)(a * (a / a));