~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/cases/cmpxchg_volatile.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; ModuleID = 'ta2.bc'
 
2
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
 
3
target triple = "i386-pc-linux-gnu"
 
4
 
 
5
%"struct.std::__1::__atomic_base.0" = type { i8 }
 
6
%"struct.std::__1::__atomic_base" = type { %"struct.std::__1::__atomic_base.0" }
 
7
%"struct.std::__1::atomic" = type { %"struct.std::__1::__atomic_base" }
 
8
 
 
9
@.str = private unnamed_addr constant [8 x i8] c"ta2.cpp\00", align 1
 
10
@__PRETTY_FUNCTION__._Z7do_testIVNSt3__16atomicIcEEcEvv = private unnamed_addr constant [63 x i8] c"void do_test() [A = volatile std::__1::atomic<char>, T = char]\00", align 1
 
11
@.str1 = private unnamed_addr constant [43 x i8] c"obj.compare_exchange_weak(x, T(2)) == true\00", align 1
 
12
@.str2 = private unnamed_addr constant [12 x i8] c"obj == T(2)\00", align 1
 
13
@.str3 = private unnamed_addr constant [10 x i8] c"x == T(3)\00", align 1
 
14
@.str4 = private unnamed_addr constant [44 x i8] c"obj.compare_exchange_weak(x, T(1)) == false\00", align 1
 
15
@.str5 = private unnamed_addr constant [10 x i8] c"x == T(2)\00", align 1
 
16
@.str6 = private unnamed_addr constant [45 x i8] c"obj.compare_exchange_strong(x, T(1)) == true\00", align 1
 
17
@.str7 = private unnamed_addr constant [12 x i8] c"obj == T(1)\00", align 1
 
18
@.str8 = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
 
19
 
 
20
define i32 @main() ssp {
 
21
entry:
 
22
  %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str8, i32 0, i32 0)) ; [#uses=0 type=i32]
 
23
  call void @_Z4testIVNSt3__16atomicIcEEcEvv()
 
24
  ret i32 0
 
25
}
 
26
 
 
27
define linkonce_odr void @_Z4testIVNSt3__16atomicIcEEcEvv() ssp {
 
28
entry:
 
29
  call void @_Z7do_testIVNSt3__16atomicIcEEcEvv()
 
30
  call void @_Z7do_testIVNSt3__16atomicIcEEcEvv()
 
31
  ret void
 
32
}
 
33
 
 
34
define linkonce_odr void @_Z7do_testIVNSt3__16atomicIcEEcEvv() ssp {
 
35
entry:
 
36
  %this.addr.i.i110 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
37
  %__m.addr.i.i111 = alloca i32, align 4
 
38
  %.atomicdst.i.i112 = alloca i8, align 1
 
39
  %this.addr.i113 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
40
  %this.addr.i90 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
41
  %__e.addr.i91 = alloca i8*, align 4
 
42
  %__d.addr.i92 = alloca i8, align 1
 
43
  %__m.addr.i93 = alloca i32, align 4
 
44
  %.atomictmp.i94 = alloca i8, align 1
 
45
  %.atomicdst.i95 = alloca i8, align 1
 
46
  %this.addr.i.i79 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
47
  %__m.addr.i.i80 = alloca i32, align 4
 
48
  %.atomicdst.i.i81 = alloca i8, align 1
 
49
  %this.addr.i82 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
50
  %this.addr.i60 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
51
  %__e.addr.i61 = alloca i8*, align 4
 
52
  %__d.addr.i62 = alloca i8, align 1
 
53
  %__m.addr.i63 = alloca i32, align 4
 
54
  %.atomictmp.i64 = alloca i8, align 1
 
55
  %.atomicdst.i65 = alloca i8, align 1
 
56
  %this.addr.i.i49 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
57
  %__m.addr.i.i50 = alloca i32, align 4
 
58
  %.atomicdst.i.i51 = alloca i8, align 1
 
59
  %this.addr.i52 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
60
  %this.addr.i46 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
61
  %__e.addr.i = alloca i8*, align 4
 
62
  %__d.addr.i47 = alloca i8, align 1
 
63
  %__m.addr.i = alloca i32, align 4
 
64
  %.atomictmp.i = alloca i8, align 1
 
65
  %.atomicdst.i = alloca i8, align 1
 
66
  %this.addr.i.i42 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
67
  %__m.addr.i.i = alloca i32, align 4
 
68
  %.atomicdst.i.i = alloca i8, align 1
 
69
  %this.addr.i43 = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
70
  %this.addr.i.i.i.i = alloca %"struct.std::__1::__atomic_base.0"*, align 4
 
71
  %__d.addr.i.i.i.i = alloca i8, align 1
 
72
  %this.addr.i.i.i = alloca %"struct.std::__1::__atomic_base"*, align 4
 
73
  %__d.addr.i.i.i = alloca i8, align 1
 
74
  %this.addr.i.i = alloca %"struct.std::__1::atomic"*, align 4
 
75
  %__d.addr.i.i = alloca i8, align 1
 
76
  %this.addr.i = alloca %"struct.std::__1::atomic"*, align 4
 
77
  %__d.addr.i = alloca i8, align 1
 
78
  %obj = alloca %"struct.std::__1::atomic", align 1
 
79
  %x = alloca i8, align 1
 
80
  store %"struct.std::__1::atomic"* %obj, %"struct.std::__1::atomic"** %this.addr.i, align 4
 
81
  store i8 0, i8* %__d.addr.i, align 1
 
82
  %this1.i = load %"struct.std::__1::atomic"** %this.addr.i
 
83
  %0 = load i8* %__d.addr.i, align 1
 
84
  store %"struct.std::__1::atomic"* %this1.i, %"struct.std::__1::atomic"** %this.addr.i.i, align 4
 
85
  store i8 %0, i8* %__d.addr.i.i, align 1
 
86
  %this1.i.i = load %"struct.std::__1::atomic"** %this.addr.i.i
 
87
  %1 = bitcast %"struct.std::__1::atomic"* %this1.i.i to %"struct.std::__1::__atomic_base"*
 
88
  %2 = load i8* %__d.addr.i.i, align 1
 
89
  store %"struct.std::__1::__atomic_base"* %1, %"struct.std::__1::__atomic_base"** %this.addr.i.i.i, align 4
 
90
  store i8 %2, i8* %__d.addr.i.i.i, align 1
 
91
  %this1.i.i.i = load %"struct.std::__1::__atomic_base"** %this.addr.i.i.i
 
92
  %3 = bitcast %"struct.std::__1::__atomic_base"* %this1.i.i.i to %"struct.std::__1::__atomic_base.0"*
 
93
  %4 = load i8* %__d.addr.i.i.i, align 1
 
94
  store %"struct.std::__1::__atomic_base.0"* %3, %"struct.std::__1::__atomic_base.0"** %this.addr.i.i.i.i, align 4
 
95
  store i8 %4, i8* %__d.addr.i.i.i.i, align 1
 
96
  %this1.i.i.i.i = load %"struct.std::__1::__atomic_base.0"** %this.addr.i.i.i.i
 
97
  %__a_.i.i.i.i = getelementptr inbounds %"struct.std::__1::__atomic_base.0"* %this1.i.i.i.i, i32 0, i32 0
 
98
  %5 = load i8* %__d.addr.i.i.i.i, align 1
 
99
  store i8 %5, i8* %__a_.i.i.i.i, align 1
 
100
  %6 = bitcast %"struct.std::__1::atomic"* %obj to %"struct.std::__1::__atomic_base.0"*
 
101
  store %"struct.std::__1::__atomic_base.0"* %6, %"struct.std::__1::__atomic_base.0"** %this.addr.i113, align 4
 
102
  %this1.i114 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i113
 
103
  store %"struct.std::__1::__atomic_base.0"* %this1.i114, %"struct.std::__1::__atomic_base.0"** %this.addr.i.i110, align 4
 
104
  store i32 5, i32* %__m.addr.i.i111, align 4
 
105
  %this1.i.i115 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i.i110
 
106
  %__a_.i.i116 = getelementptr inbounds %"struct.std::__1::__atomic_base.0"* %this1.i.i115, i32 0, i32 0
 
107
  %7 = load i32* %__m.addr.i.i111, align 4
 
108
  switch i32 %7, label %monotonic.i.i117 [
 
109
    i32 1, label %acquire.i.i118
 
110
    i32 2, label %acquire.i.i118
 
111
    i32 5, label %seqcst.i.i119
 
112
  ]
 
113
 
 
114
monotonic.i.i117:                                 ; preds = %entry
 
115
  %8 = load atomic volatile i8* %__a_.i.i116 monotonic, align 1
 
116
  store i8 %8, i8* %.atomicdst.i.i112, align 1
 
117
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120
 
118
 
 
119
acquire.i.i118:                                   ; preds = %entry, %entry
 
120
  %9 = load atomic volatile i8* %__a_.i.i116 acquire, align 1
 
121
  store i8 %9, i8* %.atomicdst.i.i112, align 1
 
122
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120
 
123
 
 
124
seqcst.i.i119:                                    ; preds = %entry
 
125
  %10 = load atomic volatile i8* %__a_.i.i116 seq_cst, align 1
 
126
  store i8 %10, i8* %.atomicdst.i.i112, align 1
 
127
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120
 
128
 
 
129
_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120:   ; preds = %seqcst.i.i119, %acquire.i.i118, %monotonic.i.i117
 
130
  %11 = load i8* %.atomicdst.i.i112
 
131
  store i8 %11, i8* %x, align 1
 
132
  %12 = bitcast %"struct.std::__1::atomic"* %obj to %"struct.std::__1::__atomic_base.0"*
 
133
  store %"struct.std::__1::__atomic_base.0"* %12, %"struct.std::__1::__atomic_base.0"** %this.addr.i90, align 4
 
134
  store i8* %x, i8** %__e.addr.i91, align 4
 
135
  store i8 2, i8* %__d.addr.i92, align 1
 
136
  store i32 5, i32* %__m.addr.i93, align 4
 
137
  %this1.i96 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i90
 
138
  %__a_.i97 = getelementptr inbounds %"struct.std::__1::__atomic_base.0"* %this1.i96, i32 0, i32 0
 
139
  %13 = load i32* %__m.addr.i93, align 4
 
140
  %14 = load i8** %__e.addr.i91, align 4
 
141
  %15 = load i8* %__d.addr.i92, align 1
 
142
  store i8 %15, i8* %.atomictmp.i94
 
143
  %16 = load i32* %__m.addr.i93, align 4
 
144
  switch i32 %13, label %monotonic.i99 [
 
145
    i32 1, label %acquire.i101
 
146
    i32 2, label %acquire.i101
 
147
    i32 3, label %release.i103
 
148
    i32 4, label %acqrel.i105
 
149
    i32 5, label %seqcst.i107
 
150
  ]
 
151
 
 
152
monotonic.i99:                                    ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120
 
153
  %17 = load i8* %14, align 1
 
154
  %18 = load i8* %.atomictmp.i94, align 1
 
155
  %19 = cmpxchg volatile i8* %__a_.i97, i8 %17, i8 %18 monotonic
 
156
  store i8 %19, i8* %14, align 1
 
157
  %20 = icmp eq i8 %19, %17
 
158
  %frombool.i98 = zext i1 %20 to i8
 
159
  store i8 %frombool.i98, i8* %.atomicdst.i95
 
160
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit109
 
161
 
 
162
acquire.i101:                                     ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120, %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120
 
163
  %21 = load i8* %14, align 1
 
164
  %22 = load i8* %.atomictmp.i94, align 1
 
165
  %23 = cmpxchg volatile i8* %__a_.i97, i8 %21, i8 %22 acquire
 
166
  store i8 %23, i8* %14, align 1
 
167
  %24 = icmp eq i8 %23, %21
 
168
  %frombool2.i100 = zext i1 %24 to i8
 
169
  store i8 %frombool2.i100, i8* %.atomicdst.i95
 
170
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit109
 
171
 
 
172
release.i103:                                     ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120
 
173
  %25 = load i8* %14, align 1
 
174
  %26 = load i8* %.atomictmp.i94, align 1
 
175
  %27 = cmpxchg volatile i8* %__a_.i97, i8 %25, i8 %26 release
 
176
  store i8 %27, i8* %14, align 1
 
177
  %28 = icmp eq i8 %27, %25
 
178
  %frombool3.i102 = zext i1 %28 to i8
 
179
  store i8 %frombool3.i102, i8* %.atomicdst.i95
 
180
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit109
 
181
 
 
182
acqrel.i105:                                      ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120
 
183
  %29 = load i8* %14, align 1
 
184
  %30 = load i8* %.atomictmp.i94, align 1
 
185
  %31 = cmpxchg volatile i8* %__a_.i97, i8 %29, i8 %30 acq_rel
 
186
  store i8 %31, i8* %14, align 1
 
187
  %32 = icmp eq i8 %31, %29
 
188
  %frombool4.i104 = zext i1 %32 to i8
 
189
  store i8 %frombool4.i104, i8* %.atomicdst.i95
 
190
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit109
 
191
 
 
192
seqcst.i107:                                      ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit120
 
193
  %33 = load i8* %14, align 1
 
194
  %34 = load i8* %.atomictmp.i94, align 1
 
195
  %35 = cmpxchg volatile i8* %__a_.i97, i8 %33, i8 %34 seq_cst
 
196
  store i8 %35, i8* %14, align 1
 
197
  %36 = icmp eq i8 %35, %33
 
198
  %frombool5.i106 = zext i1 %36 to i8
 
199
  store i8 %frombool5.i106, i8* %.atomicdst.i95
 
200
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit109
 
201
 
 
202
_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit109: ; preds = %seqcst.i107, %acqrel.i105, %release.i103, %acquire.i101, %monotonic.i99
 
203
  %37 = load i8* %.atomicdst.i95
 
204
  %tobool.i108 = trunc i8 %37 to i1
 
205
  %conv = zext i1 %tobool.i108 to i32
 
206
  %cmp = icmp eq i32 %conv, 1
 
207
  br i1 %cmp, label %cond.true, label %cond.false
 
208
 
 
209
cond.true:                                        ; preds = %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit109
 
210
  br label %cond.end
 
211
 
 
212
cond.false:                                       ; preds = %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit109
 
213
  call void @__assert_func(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 21, i8* getelementptr inbounds ([63 x i8]* @__PRETTY_FUNCTION__._Z7do_testIVNSt3__16atomicIcEEcEvv, i32 0, i32 0), i8* getelementptr inbounds ([43 x i8]* @.str1, i32 0, i32 0))
 
214
  br label %cond.end
 
215
 
 
216
cond.end:                                         ; preds = %cond.false, %cond.true
 
217
  %38 = bitcast %"struct.std::__1::atomic"* %obj to %"struct.std::__1::__atomic_base.0"*
 
218
  store %"struct.std::__1::__atomic_base.0"* %38, %"struct.std::__1::__atomic_base.0"** %this.addr.i82, align 4
 
219
  %this1.i83 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i82
 
220
  store %"struct.std::__1::__atomic_base.0"* %this1.i83, %"struct.std::__1::__atomic_base.0"** %this.addr.i.i79, align 4
 
221
  store i32 5, i32* %__m.addr.i.i80, align 4
 
222
  %this1.i.i84 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i.i79
 
223
  %__a_.i.i85 = getelementptr inbounds %"struct.std::__1::__atomic_base.0"* %this1.i.i84, i32 0, i32 0
 
224
  %39 = load i32* %__m.addr.i.i80, align 4
 
225
  switch i32 %39, label %monotonic.i.i86 [
 
226
    i32 1, label %acquire.i.i87
 
227
    i32 2, label %acquire.i.i87
 
228
    i32 5, label %seqcst.i.i88
 
229
  ]
 
230
 
 
231
monotonic.i.i86:                                  ; preds = %cond.end
 
232
  %40 = load atomic volatile i8* %__a_.i.i85 monotonic, align 1
 
233
  store i8 %40, i8* %.atomicdst.i.i81, align 1
 
234
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit89
 
235
 
 
236
acquire.i.i87:                                    ; preds = %cond.end, %cond.end
 
237
  %41 = load atomic volatile i8* %__a_.i.i85 acquire, align 1
 
238
  store i8 %41, i8* %.atomicdst.i.i81, align 1
 
239
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit89
 
240
 
 
241
seqcst.i.i88:                                     ; preds = %cond.end
 
242
  %42 = load atomic volatile i8* %__a_.i.i85 seq_cst, align 1
 
243
  store i8 %42, i8* %.atomicdst.i.i81, align 1
 
244
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit89
 
245
 
 
246
_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit89:    ; preds = %seqcst.i.i88, %acquire.i.i87, %monotonic.i.i86
 
247
  %43 = load i8* %.atomicdst.i.i81
 
248
  %conv3 = sext i8 %43 to i32
 
249
  %cmp4 = icmp eq i32 %conv3, 2
 
250
  br i1 %cmp4, label %cond.true5, label %cond.false6
 
251
 
 
252
cond.true5:                                       ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit89
 
253
  br label %cond.end7
 
254
 
 
255
cond.false6:                                      ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit89
 
256
  call void @__assert_func(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 22, i8* getelementptr inbounds ([63 x i8]* @__PRETTY_FUNCTION__._Z7do_testIVNSt3__16atomicIcEEcEvv, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str2, i32 0, i32 0))
 
257
  br label %cond.end7
 
258
 
 
259
cond.end7:                                        ; preds = %cond.false6, %cond.true5
 
260
  %44 = load i8* %x, align 1
 
261
  %conv8 = sext i8 %44 to i32
 
262
  %cmp9 = icmp eq i32 %conv8, 3
 
263
  br i1 %cmp9, label %cond.true10, label %cond.false11
 
264
 
 
265
cond.true10:                                      ; preds = %cond.end7
 
266
  br label %cond.end12
 
267
 
 
268
cond.false11:                                     ; preds = %cond.end7
 
269
  call void @__assert_func(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 23, i8* getelementptr inbounds ([63 x i8]* @__PRETTY_FUNCTION__._Z7do_testIVNSt3__16atomicIcEEcEvv, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8]* @.str3, i32 0, i32 0))
 
270
  br label %cond.end12
 
271
 
 
272
cond.end12:                                       ; preds = %cond.false11, %cond.true10
 
273
  %45 = bitcast %"struct.std::__1::atomic"* %obj to %"struct.std::__1::__atomic_base.0"*
 
274
  store %"struct.std::__1::__atomic_base.0"* %45, %"struct.std::__1::__atomic_base.0"** %this.addr.i60, align 4
 
275
  store i8* %x, i8** %__e.addr.i61, align 4
 
276
  store i8 1, i8* %__d.addr.i62, align 1
 
277
  store i32 5, i32* %__m.addr.i63, align 4
 
278
  %this1.i66 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i60
 
279
  %__a_.i67 = getelementptr inbounds %"struct.std::__1::__atomic_base.0"* %this1.i66, i32 0, i32 0
 
280
  %46 = load i32* %__m.addr.i63, align 4
 
281
  %47 = load i8** %__e.addr.i61, align 4
 
282
  %48 = load i8* %__d.addr.i62, align 1
 
283
  store i8 %48, i8* %.atomictmp.i64
 
284
  %49 = load i32* %__m.addr.i63, align 4
 
285
  switch i32 %46, label %monotonic.i69 [
 
286
    i32 1, label %acquire.i71
 
287
    i32 2, label %acquire.i71
 
288
    i32 3, label %release.i73
 
289
    i32 4, label %acqrel.i75
 
290
    i32 5, label %seqcst.i77
 
291
  ]
 
292
 
 
293
monotonic.i69:                                    ; preds = %cond.end12
 
294
  %50 = load i8* %47, align 1
 
295
  %51 = load i8* %.atomictmp.i64, align 1
 
296
  %52 = cmpxchg volatile i8* %__a_.i67, i8 %50, i8 %51 monotonic
 
297
  store i8 %52, i8* %47, align 1
 
298
  %53 = icmp eq i8 %52, %50
 
299
  %frombool.i68 = zext i1 %53 to i8
 
300
  store i8 %frombool.i68, i8* %.atomicdst.i65
 
301
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit
 
302
 
 
303
acquire.i71:                                      ; preds = %cond.end12, %cond.end12
 
304
  %54 = load i8* %47, align 1
 
305
  %55 = load i8* %.atomictmp.i64, align 1
 
306
  %56 = cmpxchg volatile i8* %__a_.i67, i8 %54, i8 %55 acquire
 
307
  store i8 %56, i8* %47, align 1
 
308
  %57 = icmp eq i8 %56, %54
 
309
  %frombool2.i70 = zext i1 %57 to i8
 
310
  store i8 %frombool2.i70, i8* %.atomicdst.i65
 
311
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit
 
312
 
 
313
release.i73:                                      ; preds = %cond.end12
 
314
  %58 = load i8* %47, align 1
 
315
  %59 = load i8* %.atomictmp.i64, align 1
 
316
  %60 = cmpxchg volatile i8* %__a_.i67, i8 %58, i8 %59 release
 
317
  store i8 %60, i8* %47, align 1
 
318
  %61 = icmp eq i8 %60, %58
 
319
  %frombool3.i72 = zext i1 %61 to i8
 
320
  store i8 %frombool3.i72, i8* %.atomicdst.i65
 
321
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit
 
322
 
 
323
acqrel.i75:                                       ; preds = %cond.end12
 
324
  %62 = load i8* %47, align 1
 
325
  %63 = load i8* %.atomictmp.i64, align 1
 
326
  %64 = cmpxchg volatile i8* %__a_.i67, i8 %62, i8 %63 acq_rel
 
327
  store i8 %64, i8* %47, align 1
 
328
  %65 = icmp eq i8 %64, %62
 
329
  %frombool4.i74 = zext i1 %65 to i8
 
330
  store i8 %frombool4.i74, i8* %.atomicdst.i65
 
331
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit
 
332
 
 
333
seqcst.i77:                                       ; preds = %cond.end12
 
334
  %66 = load i8* %47, align 1
 
335
  %67 = load i8* %.atomictmp.i64, align 1
 
336
  %68 = cmpxchg volatile i8* %__a_.i67, i8 %66, i8 %67 seq_cst
 
337
  store i8 %68, i8* %47, align 1
 
338
  %69 = icmp eq i8 %68, %66
 
339
  %frombool5.i76 = zext i1 %69 to i8
 
340
  store i8 %frombool5.i76, i8* %.atomicdst.i65
 
341
  br label %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit
 
342
 
 
343
_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit: ; preds = %seqcst.i77, %acqrel.i75, %release.i73, %acquire.i71, %monotonic.i69
 
344
  %70 = load i8* %.atomicdst.i65
 
345
  %tobool.i78 = trunc i8 %70 to i1
 
346
  %conv14 = zext i1 %tobool.i78 to i32
 
347
  %cmp15 = icmp eq i32 %conv14, 0
 
348
  br i1 %cmp15, label %cond.true16, label %cond.false17
 
349
 
 
350
cond.true16:                                      ; preds = %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit
 
351
  br label %cond.end18
 
352
 
 
353
cond.false17:                                     ; preds = %_ZNVSt3__113__atomic_baseIcLb0EE21compare_exchange_weakERccNS_12memory_orderE.exit
 
354
  call void @__assert_func(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 24, i8* getelementptr inbounds ([63 x i8]* @__PRETTY_FUNCTION__._Z7do_testIVNSt3__16atomicIcEEcEvv, i32 0, i32 0), i8* getelementptr inbounds ([44 x i8]* @.str4, i32 0, i32 0))
 
355
  br label %cond.end18
 
356
 
 
357
cond.end18:                                       ; preds = %cond.false17, %cond.true16
 
358
  %71 = bitcast %"struct.std::__1::atomic"* %obj to %"struct.std::__1::__atomic_base.0"*
 
359
  store %"struct.std::__1::__atomic_base.0"* %71, %"struct.std::__1::__atomic_base.0"** %this.addr.i52, align 4
 
360
  %this1.i53 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i52
 
361
  store %"struct.std::__1::__atomic_base.0"* %this1.i53, %"struct.std::__1::__atomic_base.0"** %this.addr.i.i49, align 4
 
362
  store i32 5, i32* %__m.addr.i.i50, align 4
 
363
  %this1.i.i54 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i.i49
 
364
  %__a_.i.i55 = getelementptr inbounds %"struct.std::__1::__atomic_base.0"* %this1.i.i54, i32 0, i32 0
 
365
  %72 = load i32* %__m.addr.i.i50, align 4
 
366
  switch i32 %72, label %monotonic.i.i56 [
 
367
    i32 1, label %acquire.i.i57
 
368
    i32 2, label %acquire.i.i57
 
369
    i32 5, label %seqcst.i.i58
 
370
  ]
 
371
 
 
372
monotonic.i.i56:                                  ; preds = %cond.end18
 
373
  %73 = load atomic volatile i8* %__a_.i.i55 monotonic, align 1
 
374
  store i8 %73, i8* %.atomicdst.i.i51, align 1
 
375
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit59
 
376
 
 
377
acquire.i.i57:                                    ; preds = %cond.end18, %cond.end18
 
378
  %74 = load atomic volatile i8* %__a_.i.i55 acquire, align 1
 
379
  store i8 %74, i8* %.atomicdst.i.i51, align 1
 
380
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit59
 
381
 
 
382
seqcst.i.i58:                                     ; preds = %cond.end18
 
383
  %75 = load atomic volatile i8* %__a_.i.i55 seq_cst, align 1
 
384
  store i8 %75, i8* %.atomicdst.i.i51, align 1
 
385
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit59
 
386
 
 
387
_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit59:    ; preds = %seqcst.i.i58, %acquire.i.i57, %monotonic.i.i56
 
388
  %76 = load i8* %.atomicdst.i.i51
 
389
  %conv20 = sext i8 %76 to i32
 
390
  %cmp21 = icmp eq i32 %conv20, 2
 
391
  br i1 %cmp21, label %cond.true22, label %cond.false23
 
392
 
 
393
cond.true22:                                      ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit59
 
394
  br label %cond.end24
 
395
 
 
396
cond.false23:                                     ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit59
 
397
  call void @__assert_func(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 25, i8* getelementptr inbounds ([63 x i8]* @__PRETTY_FUNCTION__._Z7do_testIVNSt3__16atomicIcEEcEvv, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str2, i32 0, i32 0))
 
398
  br label %cond.end24
 
399
 
 
400
cond.end24:                                       ; preds = %cond.false23, %cond.true22
 
401
  %77 = load i8* %x, align 1
 
402
  %conv25 = sext i8 %77 to i32
 
403
  %cmp26 = icmp eq i32 %conv25, 2
 
404
  br i1 %cmp26, label %cond.true27, label %cond.false28
 
405
 
 
406
cond.true27:                                      ; preds = %cond.end24
 
407
  br label %cond.end29
 
408
 
 
409
cond.false28:                                     ; preds = %cond.end24
 
410
  call void @__assert_func(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 26, i8* getelementptr inbounds ([63 x i8]* @__PRETTY_FUNCTION__._Z7do_testIVNSt3__16atomicIcEEcEvv, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8]* @.str5, i32 0, i32 0))
 
411
  br label %cond.end29
 
412
 
 
413
cond.end29:                                       ; preds = %cond.false28, %cond.true27
 
414
  store i8 2, i8* %x, align 1
 
415
  %78 = bitcast %"struct.std::__1::atomic"* %obj to %"struct.std::__1::__atomic_base.0"*
 
416
  store %"struct.std::__1::__atomic_base.0"* %78, %"struct.std::__1::__atomic_base.0"** %this.addr.i46, align 4
 
417
  store i8* %x, i8** %__e.addr.i, align 4
 
418
  store i8 1, i8* %__d.addr.i47, align 1
 
419
  store i32 5, i32* %__m.addr.i, align 4
 
420
  %this1.i48 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i46
 
421
  %__a_.i = getelementptr inbounds %"struct.std::__1::__atomic_base.0"* %this1.i48, i32 0, i32 0
 
422
  %79 = load i32* %__m.addr.i, align 4
 
423
  %80 = load i8** %__e.addr.i, align 4
 
424
  %81 = load i8* %__d.addr.i47, align 1
 
425
  store i8 %81, i8* %.atomictmp.i
 
426
  %82 = load i32* %__m.addr.i, align 4
 
427
  switch i32 %79, label %monotonic.i [
 
428
    i32 1, label %acquire.i
 
429
    i32 2, label %acquire.i
 
430
    i32 3, label %release.i
 
431
    i32 4, label %acqrel.i
 
432
    i32 5, label %seqcst.i
 
433
  ]
 
434
 
 
435
monotonic.i:                                      ; preds = %cond.end29
 
436
  %83 = load i8* %80, align 1
 
437
  %84 = load i8* %.atomictmp.i, align 1
 
438
  %85 = cmpxchg volatile i8* %__a_.i, i8 %83, i8 %84 monotonic
 
439
  store i8 %85, i8* %80, align 1
 
440
  %86 = icmp eq i8 %85, %83
 
441
  %frombool.i = zext i1 %86 to i8
 
442
  store i8 %frombool.i, i8* %.atomicdst.i
 
443
  br label %_ZNVSt3__113__atomic_baseIcLb0EE23compare_exchange_strongERccNS_12memory_orderE.exit
 
444
 
 
445
acquire.i:                                        ; preds = %cond.end29, %cond.end29
 
446
  %87 = load i8* %80, align 1
 
447
  %88 = load i8* %.atomictmp.i, align 1
 
448
  %89 = cmpxchg volatile i8* %__a_.i, i8 %87, i8 %88 acquire
 
449
  store i8 %89, i8* %80, align 1
 
450
  %90 = icmp eq i8 %89, %87
 
451
  %frombool2.i = zext i1 %90 to i8
 
452
  store i8 %frombool2.i, i8* %.atomicdst.i
 
453
  br label %_ZNVSt3__113__atomic_baseIcLb0EE23compare_exchange_strongERccNS_12memory_orderE.exit
 
454
 
 
455
release.i:                                        ; preds = %cond.end29
 
456
  %91 = load i8* %80, align 1
 
457
  %92 = load i8* %.atomictmp.i, align 1
 
458
  %93 = cmpxchg volatile i8* %__a_.i, i8 %91, i8 %92 release
 
459
  store i8 %93, i8* %80, align 1
 
460
  %94 = icmp eq i8 %93, %91
 
461
  %frombool3.i = zext i1 %94 to i8
 
462
  store i8 %frombool3.i, i8* %.atomicdst.i
 
463
  br label %_ZNVSt3__113__atomic_baseIcLb0EE23compare_exchange_strongERccNS_12memory_orderE.exit
 
464
 
 
465
acqrel.i:                                         ; preds = %cond.end29
 
466
  %95 = load i8* %80, align 1
 
467
  %96 = load i8* %.atomictmp.i, align 1
 
468
  %97 = cmpxchg volatile i8* %__a_.i, i8 %95, i8 %96 acq_rel
 
469
  store i8 %97, i8* %80, align 1
 
470
  %98 = icmp eq i8 %97, %95
 
471
  %frombool4.i = zext i1 %98 to i8
 
472
  store i8 %frombool4.i, i8* %.atomicdst.i
 
473
  br label %_ZNVSt3__113__atomic_baseIcLb0EE23compare_exchange_strongERccNS_12memory_orderE.exit
 
474
 
 
475
seqcst.i:                                         ; preds = %cond.end29
 
476
  %99 = load i8* %80, align 1
 
477
  %100 = load i8* %.atomictmp.i, align 1
 
478
  %101 = cmpxchg volatile i8* %__a_.i, i8 %99, i8 %100 seq_cst
 
479
  store i8 %101, i8* %80, align 1
 
480
  %102 = icmp eq i8 %101, %99
 
481
  %frombool5.i = zext i1 %102 to i8
 
482
  store i8 %frombool5.i, i8* %.atomicdst.i
 
483
  br label %_ZNVSt3__113__atomic_baseIcLb0EE23compare_exchange_strongERccNS_12memory_orderE.exit
 
484
 
 
485
_ZNVSt3__113__atomic_baseIcLb0EE23compare_exchange_strongERccNS_12memory_orderE.exit: ; preds = %seqcst.i, %acqrel.i, %release.i, %acquire.i, %monotonic.i
 
486
  %103 = load i8* %.atomicdst.i
 
487
  %tobool.i = trunc i8 %103 to i1
 
488
  %conv31 = zext i1 %tobool.i to i32
 
489
  %cmp32 = icmp eq i32 %conv31, 1
 
490
  br i1 %cmp32, label %cond.true33, label %cond.false34
 
491
 
 
492
cond.true33:                                      ; preds = %_ZNVSt3__113__atomic_baseIcLb0EE23compare_exchange_strongERccNS_12memory_orderE.exit
 
493
  br label %cond.end35
 
494
 
 
495
cond.false34:                                     ; preds = %_ZNVSt3__113__atomic_baseIcLb0EE23compare_exchange_strongERccNS_12memory_orderE.exit
 
496
  call void @__assert_func(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 28, i8* getelementptr inbounds ([63 x i8]* @__PRETTY_FUNCTION__._Z7do_testIVNSt3__16atomicIcEEcEvv, i32 0, i32 0), i8* getelementptr inbounds ([45 x i8]* @.str6, i32 0, i32 0))
 
497
  br label %cond.end35
 
498
 
 
499
cond.end35:                                       ; preds = %cond.false34, %cond.true33
 
500
  %104 = bitcast %"struct.std::__1::atomic"* %obj to %"struct.std::__1::__atomic_base.0"*
 
501
  store %"struct.std::__1::__atomic_base.0"* %104, %"struct.std::__1::__atomic_base.0"** %this.addr.i43, align 4
 
502
  %this1.i44 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i43
 
503
  store %"struct.std::__1::__atomic_base.0"* %this1.i44, %"struct.std::__1::__atomic_base.0"** %this.addr.i.i42, align 4
 
504
  store i32 5, i32* %__m.addr.i.i, align 4
 
505
  %this1.i.i45 = load %"struct.std::__1::__atomic_base.0"** %this.addr.i.i42
 
506
  %__a_.i.i = getelementptr inbounds %"struct.std::__1::__atomic_base.0"* %this1.i.i45, i32 0, i32 0
 
507
  %105 = load i32* %__m.addr.i.i, align 4
 
508
  switch i32 %105, label %monotonic.i.i [
 
509
    i32 1, label %acquire.i.i
 
510
    i32 2, label %acquire.i.i
 
511
    i32 5, label %seqcst.i.i
 
512
  ]
 
513
 
 
514
monotonic.i.i:                                    ; preds = %cond.end35
 
515
  %106 = load atomic volatile i8* %__a_.i.i monotonic, align 1
 
516
  store i8 %106, i8* %.atomicdst.i.i, align 1
 
517
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit
 
518
 
 
519
acquire.i.i:                                      ; preds = %cond.end35, %cond.end35
 
520
  %107 = load atomic volatile i8* %__a_.i.i acquire, align 1
 
521
  store i8 %107, i8* %.atomicdst.i.i, align 1
 
522
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit
 
523
 
 
524
seqcst.i.i:                                       ; preds = %cond.end35
 
525
  %108 = load atomic volatile i8* %__a_.i.i seq_cst, align 1
 
526
  store i8 %108, i8* %.atomicdst.i.i, align 1
 
527
  br label %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit
 
528
 
 
529
_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit:      ; preds = %seqcst.i.i, %acquire.i.i, %monotonic.i.i
 
530
  %109 = load i8* %.atomicdst.i.i
 
531
  %conv37 = sext i8 %109 to i32
 
532
  %cmp38 = icmp eq i32 %conv37, 1
 
533
  br i1 %cmp38, label %cond.true39, label %cond.false40
 
534
 
 
535
cond.true39:                                      ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit
 
536
  br label %cond.end41
 
537
 
 
538
cond.false40:                                     ; preds = %_ZNVKSt3__113__atomic_baseIcLb0EEcvcEv.exit
 
539
  call void @__assert_func(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 29, i8* getelementptr inbounds ([63 x i8]* @__PRETTY_FUNCTION__._Z7do_testIVNSt3__16atomicIcEEcEvv, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str7, i32 0, i32 0))
 
540
  br label %cond.end41
 
541
 
 
542
cond.end41:                                       ; preds = %cond.false40, %cond.true39
 
543
  ret void
 
544
}
 
545
 
 
546
declare void @__assert_func(i8*, i32, i8*, i8*)
 
547
declare i32 @printf(i8*, ...)
 
548