1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4
2 // RUN: %clang_cc1 -triple x86_64-linux-gnu -target-cpu core2 %s -emit-llvm -o - | FileCheck -check-prefixes=X64 %s
3 // RUN: %clang_cc1 -triple i686-linux-gnu -target-cpu core2 %s -emit-llvm -o - | FileCheck -check-prefixes=X86 %s
6 // X64-LABEL: define dso_local double @test_double_post_inc(
7 // X64-SAME: ) #[[ATTR0:[0-9]+]] {
9 // X64-NEXT: [[TMP0:%.*]] = atomicrmw fadd ptr @test_double_post_inc.n, double 1.000000e+00 seq_cst, align 8
10 // X64-NEXT: ret double [[TMP0]]
12 // X86-LABEL: define dso_local double @test_double_post_inc(
13 // X86-SAME: ) #[[ATTR0:[0-9]+]] {
15 // X86-NEXT: [[TMP0:%.*]] = atomicrmw fadd ptr @test_double_post_inc.n, double 1.000000e+00 seq_cst, align 8
16 // X86-NEXT: ret double [[TMP0]]
18 double test_double_post_inc()
20 static _Atomic
double n
;
24 // X64-LABEL: define dso_local double @test_double_post_dc(
25 // X64-SAME: ) #[[ATTR0]] {
27 // X64-NEXT: [[TMP0:%.*]] = atomicrmw fsub ptr @test_double_post_dc.n, double 1.000000e+00 seq_cst, align 8
28 // X64-NEXT: ret double [[TMP0]]
30 // X86-LABEL: define dso_local double @test_double_post_dc(
31 // X86-SAME: ) #[[ATTR0]] {
33 // X86-NEXT: [[TMP0:%.*]] = atomicrmw fsub ptr @test_double_post_dc.n, double 1.000000e+00 seq_cst, align 8
34 // X86-NEXT: ret double [[TMP0]]
36 double test_double_post_dc()
38 static _Atomic
double n
;
42 // X64-LABEL: define dso_local double @test_double_pre_dc(
43 // X64-SAME: ) #[[ATTR0]] {
45 // X64-NEXT: [[TMP0:%.*]] = atomicrmw fsub ptr @test_double_pre_dc.n, double 1.000000e+00 seq_cst, align 8
46 // X64-NEXT: [[TMP1:%.*]] = fsub double [[TMP0]], 1.000000e+00
47 // X64-NEXT: ret double [[TMP1]]
49 // X86-LABEL: define dso_local double @test_double_pre_dc(
50 // X86-SAME: ) #[[ATTR0]] {
52 // X86-NEXT: [[TMP0:%.*]] = atomicrmw fsub ptr @test_double_pre_dc.n, double 1.000000e+00 seq_cst, align 8
53 // X86-NEXT: [[TMP1:%.*]] = fsub double [[TMP0]], 1.000000e+00
54 // X86-NEXT: ret double [[TMP1]]
56 double test_double_pre_dc()
58 static _Atomic
double n
;
62 // X64-LABEL: define dso_local double @test_double_pre_inc(
63 // X64-SAME: ) #[[ATTR0]] {
65 // X64-NEXT: [[TMP0:%.*]] = atomicrmw fadd ptr @test_double_pre_inc.n, double 1.000000e+00 seq_cst, align 8
66 // X64-NEXT: [[TMP1:%.*]] = fadd double [[TMP0]], 1.000000e+00
67 // X64-NEXT: ret double [[TMP1]]
69 // X86-LABEL: define dso_local double @test_double_pre_inc(
70 // X86-SAME: ) #[[ATTR0]] {
72 // X86-NEXT: [[TMP0:%.*]] = atomicrmw fadd ptr @test_double_pre_inc.n, double 1.000000e+00 seq_cst, align 8
73 // X86-NEXT: [[TMP1:%.*]] = fadd double [[TMP0]], 1.000000e+00
74 // X86-NEXT: ret double [[TMP1]]
76 double test_double_pre_inc()
78 static _Atomic
double n
;
82 // X64-LABEL: define dso_local i32 @pr107054(
83 // X64-SAME: ) #[[ATTR0]] {
85 // X64-NEXT: [[TMP0:%.*]] = atomicrmw fadd ptr @pr107054.n, double 1.000000e+00 seq_cst, align 8
86 // X64-NEXT: [[TMP1:%.*]] = fadd double [[TMP0]], 1.000000e+00
87 // X64-NEXT: [[CMP:%.*]] = fcmp oeq double [[TMP1]], 1.000000e+00
88 // X64-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32
89 // X64-NEXT: ret i32 [[CONV]]
91 // X86-LABEL: define dso_local i32 @pr107054(
92 // X86-SAME: ) #[[ATTR0]] {
94 // X86-NEXT: [[TMP0:%.*]] = atomicrmw fadd ptr @pr107054.n, double 1.000000e+00 seq_cst, align 8
95 // X86-NEXT: [[TMP1:%.*]] = fadd double [[TMP0]], 1.000000e+00
96 // X86-NEXT: [[CMP:%.*]] = fcmp oeq double [[TMP1]], 1.000000e+00
97 // X86-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32
98 // X86-NEXT: ret i32 [[CONV]]
102 static _Atomic
double n
;