[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / PowerPC / builtins-ppc-xlcompat-fnabs.c
blob2889f38f01068f2904d9ed12a5621bfaefffda16
1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu \
3 // RUN: -emit-llvm %s -target-cpu pwr8 -o - | FileCheck %s
4 // RUN: %clang_cc1 -triple powerpc-unknown-aix \
5 // RUN: -emit-llvm %s -target-cpu pwr8 -o - | FileCheck %s
6 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu \
7 // RUN: -emit-llvm %s -target-cpu pwr7 -o - | FileCheck %s
8 // RUN: %clang_cc1 -triple powerpc64-unknown-aix \
9 // RUN: -emit-llvm %s -target-cpu pwr7 -o - | FileCheck %s
10 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu \
11 // RUN: -emit-llvm %s -target-cpu pwr6 -o - | FileCheck %s
12 // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu \
13 // RUN: -emit-llvm %s -target-cpu pwr6 -o - | FileCheck %s
14 // RUN: %clang_cc1 -triple powerpc64-unknown-aix \
15 // RUN: -emit-llvm %s -target-cpu pwr6 -o - | FileCheck %s
16 // RUN: %clang_cc1 -triple powerpc-unknown-aix \
17 // RUN: -emit-llvm %s -target-cpu pwr6 -o - | FileCheck %s
19 extern float f;
20 extern double d;
22 // CHECK-LABEL: @test_fnabs(
23 // CHECK: [[TMP0:%.*]] = load double, ptr @d
24 // CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.ppc.fnabs(double [[TMP0]])
25 // CHECK-NEXT: ret double [[TMP1]]
26 double test_fnabs() {
27 return __fnabs (d);
30 // CHECK-LABEL: @test_fnabss(
31 // CHECK: [[TMP0:%.*]] = load float, ptr @f
32 // CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.ppc.fnabss(float [[TMP0]])
33 // CHECK-NEXT: ret float [[TMP1]]
34 float test_fnabss() {
35 return __fnabss (f);