1 struct S {
2 int :1;
3 signed int s:2;
4 unsigned int u:3;
5 long l;
6 double d;
7 };
8
os(int i,struct S * b)9 int os(int i, struct S *b) { return i || b->s; }
ou(int i,struct S * b)10 int ou(int i, struct S *b) { return i || b->u; }
ol(int i,struct S * b)11 int ol(int i, struct S *b) { return i || b->l; }
od(int i,struct S * b)12 int od(int i, struct S *b) { return i || b->d; }
13
as(int i,struct S * b)14 int as(int i, struct S *b) { return i && b->s; }
au(int i,struct S * b)15 int au(int i, struct S *b) { return i && b->u; }
al(int i,struct S * b)16 int al(int i, struct S *b) { return i && b->l; }
ad(int i,struct S * b)17 int ad(int i, struct S *b) { return i && b->d; }
18
19 /*
20 * check-name: logical
21 * check-command: test-linearize -m64 -fdump-ir -Wno-decl $file
22 * check-assert: sizeof(void *) == 8 && sizeof(long) == 8 && sizeof(double) == 8
23 *
24 * check-output-start
25 os:
26 .L0:
27 <entry-point>
28 store.32 %arg1 -> 0[i]
29 store.64 %arg2 -> 0[b]
30 load.32 %r2 <- 0[i]
31 setne.1 %r3 <- %r2, $0
32 phisrc.32 %phi1 <- $1
33 cbr %r3, .L3, .L2
34
35 .L2:
36 load.64 %r4 <- 0[b]
37 load.32 %r5 <- 0[%r4]
38 lsr.32 %r6 <- %r5, $1
39 trunc.2 %r7 <- (32) %r6
40 setne.1 %r8 <- %r7, $0
41 zext.32 %r9 <- (1) %r8
42 phisrc.32 %phi2 <- %r9
43 br .L3
44
45 .L3:
46 phi.32 %r1 <- %phi1, %phi2
47 phisrc.32 %phi3(return) <- %r1
48 br .L1
49
50 .L1:
51 phi.32 %r10 <- %phi3(return)
52 ret.32 %r10
53
54
55 ou:
56 .L4:
57 <entry-point>
58 store.32 %arg1 -> 0[i]
59 store.64 %arg2 -> 0[b]
60 load.32 %r12 <- 0[i]
61 setne.1 %r13 <- %r12, $0
62 phisrc.32 %phi4 <- $1
63 cbr %r13, .L7, .L6
64
65 .L6:
66 load.64 %r14 <- 0[b]
67 load.32 %r15 <- 0[%r14]
68 lsr.32 %r16 <- %r15, $3
69 trunc.3 %r17 <- (32) %r16
70 setne.1 %r18 <- %r17, $0
71 zext.32 %r19 <- (1) %r18
72 phisrc.32 %phi5 <- %r19
73 br .L7
74
75 .L7:
76 phi.32 %r11 <- %phi4, %phi5
77 phisrc.32 %phi6(return) <- %r11
78 br .L5
79
80 .L5:
81 phi.32 %r20 <- %phi6(return)
82 ret.32 %r20
83
84
85 ol:
86 .L8:
87 <entry-point>
88 store.32 %arg1 -> 0[i]
89 store.64 %arg2 -> 0[b]
90 load.32 %r22 <- 0[i]
91 setne.1 %r23 <- %r22, $0
92 phisrc.32 %phi7 <- $1
93 cbr %r23, .L11, .L10
94
95 .L10:
96 load.64 %r24 <- 0[b]
97 load.64 %r25 <- 8[%r24]
98 setne.1 %r26 <- %r25, $0
99 zext.32 %r27 <- (1) %r26
100 phisrc.32 %phi8 <- %r27
101 br .L11
102
103 .L11:
104 phi.32 %r21 <- %phi7, %phi8
105 phisrc.32 %phi9(return) <- %r21
106 br .L9
107
108 .L9:
109 phi.32 %r28 <- %phi9(return)
110 ret.32 %r28
111
112
113 od:
114 .L12:
115 <entry-point>
116 store.32 %arg1 -> 0[i]
117 store.64 %arg2 -> 0[b]
118 load.32 %r30 <- 0[i]
119 setne.1 %r31 <- %r30, $0
120 phisrc.32 %phi10 <- $1
121 cbr %r31, .L15, .L14
122
123 .L14:
124 load.64 %r32 <- 0[b]
125 load.64 %r33 <- 16[%r32]
126 setfval.64 %r34 <- 0.000000e+00
127 fcmpune.1 %r35 <- %r33, %r34
128 zext.32 %r36 <- (1) %r35
129 phisrc.32 %phi11 <- %r36
130 br .L15
131
132 .L15:
133 phi.32 %r29 <- %phi10, %phi11
134 phisrc.32 %phi12(return) <- %r29
135 br .L13
136
137 .L13:
138 phi.32 %r37 <- %phi12(return)
139 ret.32 %r37
140
141
142 as:
143 .L16:
144 <entry-point>
145 store.32 %arg1 -> 0[i]
146 store.64 %arg2 -> 0[b]
147 load.32 %r39 <- 0[i]
148 setne.1 %r40 <- %r39, $0
149 phisrc.32 %phi13 <- $0
150 cbr %r40, .L18, .L19
151
152 .L18:
153 load.64 %r41 <- 0[b]
154 load.32 %r42 <- 0[%r41]
155 lsr.32 %r43 <- %r42, $1
156 trunc.2 %r44 <- (32) %r43
157 setne.1 %r45 <- %r44, $0
158 zext.32 %r46 <- (1) %r45
159 phisrc.32 %phi14 <- %r46
160 br .L19
161
162 .L19:
163 phi.32 %r38 <- %phi13, %phi14
164 phisrc.32 %phi15(return) <- %r38
165 br .L17
166
167 .L17:
168 phi.32 %r47 <- %phi15(return)
169 ret.32 %r47
170
171
172 au:
173 .L20:
174 <entry-point>
175 store.32 %arg1 -> 0[i]
176 store.64 %arg2 -> 0[b]
177 load.32 %r49 <- 0[i]
178 setne.1 %r50 <- %r49, $0
179 phisrc.32 %phi16 <- $0
180 cbr %r50, .L22, .L23
181
182 .L22:
183 load.64 %r51 <- 0[b]
184 load.32 %r52 <- 0[%r51]
185 lsr.32 %r53 <- %r52, $3
186 trunc.3 %r54 <- (32) %r53
187 setne.1 %r55 <- %r54, $0
188 zext.32 %r56 <- (1) %r55
189 phisrc.32 %phi17 <- %r56
190 br .L23
191
192 .L23:
193 phi.32 %r48 <- %phi16, %phi17
194 phisrc.32 %phi18(return) <- %r48
195 br .L21
196
197 .L21:
198 phi.32 %r57 <- %phi18(return)
199 ret.32 %r57
200
201
202 al:
203 .L24:
204 <entry-point>
205 store.32 %arg1 -> 0[i]
206 store.64 %arg2 -> 0[b]
207 load.32 %r59 <- 0[i]
208 setne.1 %r60 <- %r59, $0
209 phisrc.32 %phi19 <- $0
210 cbr %r60, .L26, .L27
211
212 .L26:
213 load.64 %r61 <- 0[b]
214 load.64 %r62 <- 8[%r61]
215 setne.1 %r63 <- %r62, $0
216 zext.32 %r64 <- (1) %r63
217 phisrc.32 %phi20 <- %r64
218 br .L27
219
220 .L27:
221 phi.32 %r58 <- %phi19, %phi20
222 phisrc.32 %phi21(return) <- %r58
223 br .L25
224
225 .L25:
226 phi.32 %r65 <- %phi21(return)
227 ret.32 %r65
228
229
230 ad:
231 .L28:
232 <entry-point>
233 store.32 %arg1 -> 0[i]
234 store.64 %arg2 -> 0[b]
235 load.32 %r67 <- 0[i]
236 setne.1 %r68 <- %r67, $0
237 phisrc.32 %phi22 <- $0
238 cbr %r68, .L30, .L31
239
240 .L30:
241 load.64 %r69 <- 0[b]
242 load.64 %r70 <- 16[%r69]
243 setfval.64 %r71 <- 0.000000e+00
244 fcmpune.1 %r72 <- %r70, %r71
245 zext.32 %r73 <- (1) %r72
246 phisrc.32 %phi23 <- %r73
247 br .L31
248
249 .L31:
250 phi.32 %r66 <- %phi22, %phi23
251 phisrc.32 %phi24(return) <- %r66
252 br .L29
253
254 .L29:
255 phi.32 %r74 <- %phi24(return)
256 ret.32 %r74
257
258
259 * check-output-end
260 */
261