[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / PowerPC / builtins-ppc-xlcompat-swdiv_nochk.c
blobaf6b0b887e98c08ff1e50a0ef5bb0728150d0095
1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu \
3 // RUN: -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s
4 // RUN: %clang_cc1 -triple powerpc64-unknown-aix \
5 // RUN: -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s
7 extern double a;
8 extern double b;
9 extern double c;
10 extern float d;
11 extern float e;
12 extern float f;
14 // CHECK-LABEL: @test_swdiv_nochk(
15 // CHECK: [[TMP0:%.*]] = load double, ptr @a, align 8
16 // CHECK-NEXT: [[TMP1:%.*]] = load double, ptr @b, align 8
17 // CHECK-NEXT: [[SWDIV_NOCHK:%.*]] = fdiv fast double [[TMP0]], [[TMP1]]
18 // CHECK-NEXT: ret double [[SWDIV_NOCHK]]
20 double test_swdiv_nochk() {
21 return __swdiv_nochk(a, b);
24 // CHECK-LABEL: @test_swdivs_nochk(
25 // CHECK: [[TMP0:%.*]] = load float, ptr @d, align 4
26 // CHECK-NEXT: [[TMP1:%.*]] = load float, ptr @e, align 4
27 // CHECK-NEXT: [[SWDIV_NOCHK:%.*]] = fdiv fast float [[TMP0]], [[TMP1]]
28 // CHECK-NEXT: ret float [[SWDIV_NOCHK]]
30 float test_swdivs_nochk() {
31 return __swdivs_nochk(d, e);
34 // CHECK-LABEL: @test_flags_swdiv_nochk(
35 // CHECK: [[TMP0:%.*]] = load double, ptr @a, align 8
36 // CHECK-NEXT: [[TMP1:%.*]] = load double, ptr @b, align 8
37 // CHECK-NEXT: [[SWDIV_NOCHK:%.*]] = fdiv fast double [[TMP0]], [[TMP1]]
38 // CHECK-NEXT: [[TMP2:%.*]] = load double, ptr @c, align 8
39 // CHECK-NEXT: [[ADD:%.*]] = fadd double [[SWDIV_NOCHK]], [[TMP2]]
40 // CHECK-NEXT: ret double [[ADD]]
42 double test_flags_swdiv_nochk() {
43 return __swdiv_nochk(a, b) + c;
46 // CHECK-LABEL: @test_flags_swdivs_nochk(
47 // CHECK: [[TMP0:%.*]] = load float, ptr @d, align 4
48 // CHECK-NEXT: [[TMP1:%.*]] = load float, ptr @e, align 4
49 // CHECK-NEXT: [[SWDIV_NOCHK:%.*]] = fdiv fast float [[TMP0]], [[TMP1]]
50 // CHECK-NEXT: [[TMP2:%.*]] = load float, ptr @f, align 4
51 // CHECK-NEXT: [[ADD:%.*]] = fadd float [[SWDIV_NOCHK]], [[TMP2]]
52 // CHECK-NEXT: ret float [[ADD]]
54 float test_flags_swdivs_nochk() {
55 return __swdivs_nochk(d, e) + f;
58 // CHECK-LABEL: @test_builtin_ppc_swdiv_nochk(
59 // CHECK: [[TMP0:%.*]] = load double, ptr @a, align 8
60 // CHECK-NEXT: [[TMP1:%.*]] = load double, ptr @b, align 8
61 // CHECK-NEXT: [[SWDIV_NOCHK:%.*]] = fdiv fast double [[TMP0]], [[TMP1]]
62 // CHECK-NEXT: ret double [[SWDIV_NOCHK]]
64 double test_builtin_ppc_swdiv_nochk() {
65 return __builtin_ppc_swdiv_nochk(a, b);
68 // CHECK-LABEL: @test_builtin_ppc_swdivs_nochk(
69 // CHECK: [[TMP0:%.*]] = load float, ptr @d, align 4
70 // CHECK-NEXT: [[TMP1:%.*]] = load float, ptr @e, align 4
71 // CHECK-NEXT: [[SWDIV_NOCHK:%.*]] = fdiv fast float [[TMP0]], [[TMP1]]
72 // CHECK-NEXT: ret float [[SWDIV_NOCHK]]
74 float test_builtin_ppc_swdivs_nochk() {
75 return __builtin_ppc_swdivs_nochk(d, e);
78 // CHECK-LABEL: @test_flags_builtin_ppc_swdiv_nochk(
79 // CHECK: [[TMP0:%.*]] = load double, ptr @a, align 8
80 // CHECK-NEXT: [[TMP1:%.*]] = load double, ptr @b, align 8
81 // CHECK-NEXT: [[SWDIV_NOCHK:%.*]] = fdiv fast double [[TMP0]], [[TMP1]]
82 // CHECK-NEXT: [[TMP2:%.*]] = load double, ptr @c, align 8
83 // CHECK-NEXT: [[ADD:%.*]] = fadd double [[SWDIV_NOCHK]], [[TMP2]]
84 // CHECK-NEXT: ret double [[ADD]]
86 double test_flags_builtin_ppc_swdiv_nochk() {
87 return __builtin_ppc_swdiv_nochk(a, b) + c;
90 // CHECK-LABEL: @test_flags_builtin_ppc_swdivs_nochk(
91 // CHECK: [[TMP0:%.*]] = load float, ptr @d, align 4
92 // CHECK-NEXT: [[TMP1:%.*]] = load float, ptr @e, align 4
93 // CHECK-NEXT: [[SWDIV_NOCHK:%.*]] = fdiv fast float [[TMP0]], [[TMP1]]
94 // CHECK-NEXT: [[TMP2:%.*]] = load float, ptr @f, align 4
95 // CHECK-NEXT: [[ADD:%.*]] = fadd float [[SWDIV_NOCHK]], [[TMP2]]
96 // CHECK-NEXT: ret float [[ADD]]
98 float test_flags_builtin_ppc_swdivs_nochk() {
99 return __builtin_ppc_swdivs_nochk(d, e) + f;