function_hooks/unwind: introduce return_implies_exact()
[smatch.git] / validation / linear / shift-assign1.c
blob4c96fc283121060724e79bb38ed3c1c395f5edce
1 typedef __INT16_TYPE__ s16;
2 typedef __INT32_TYPE__ s32;
3 typedef __INT64_TYPE__ s64;
4 typedef __UINT16_TYPE__ u16;
5 typedef __UINT32_TYPE__ u32;
6 typedef __UINT64_TYPE__ u64;
8 s16 s16s16(s16 a, s16 b) { a >>= b; return a; }
9 s16 s16s32(s16 a, s32 b) { a >>= b; return a; }
10 s16 s16s64(s16 a, s64 b) { a >>= b; return a; }
11 s16 s16u16(s16 a, u16 b) { a >>= b; return a; }
12 s16 s16u32(s16 a, u32 b) { a >>= b; return a; }
13 s16 s16u64(s16 a, u64 b) { a >>= b; return a; }
14 s32 s32s16(s32 a, s16 b) { a >>= b; return a; }
15 s32 s32s32(s32 a, s32 b) { a >>= b; return a; }
16 s32 s32s64(s32 a, s64 b) { a >>= b; return a; }
17 s32 s32u16(s32 a, u16 b) { a >>= b; return a; }
18 s32 s32u32(s32 a, u32 b) { a >>= b; return a; }
19 s32 s32u64(s32 a, u64 b) { a >>= b; return a; }
20 s64 s64s16(s64 a, s16 b);
21 s64 s64s32(s64 a, s32 b);
22 s64 s64s64(s64 a, s64 b) { a >>= b; return a; }
23 s64 s64u16(s64 a, u16 b) { a >>= b; return a; }
24 s64 s64u32(s64 a, u32 b) { a >>= b; return a; }
25 s64 s64u64(s64 a, u64 b) { a >>= b; return a; }
26 u16 u16s16(u16 a, s16 b) { a >>= b; return a; }
27 u16 u16s32(u16 a, s32 b) { a >>= b; return a; }
28 u16 u16s64(u16 a, s64 b) { a >>= b; return a; }
29 u16 u16u16(u16 a, u16 b) { a >>= b; return a; }
30 u16 u16u32(u16 a, u32 b) { a >>= b; return a; }
31 u16 u16u64(u16 a, u64 b) { a >>= b; return a; }
32 u32 u32s16(u32 a, s16 b) { a >>= b; return a; }
33 u32 u32s32(u32 a, s32 b) { a >>= b; return a; }
34 u32 u32s64(u32 a, s64 b) { a >>= b; return a; }
35 u32 u32u16(u32 a, u16 b) { a >>= b; return a; }
36 u32 u32u32(u32 a, u32 b) { a >>= b; return a; }
37 u32 u32u64(u32 a, u64 b) { a >>= b; return a; }
38 u64 u64s16(u64 a, s16 b);
39 u64 u64s32(u64 a, s32 b);
40 u64 u64s64(u64 a, s64 b) { a >>= b; return a; }
41 u64 u64u16(u64 a, u16 b) { a >>= b; return a; }
42 u64 u64u32(u64 a, u32 b) { a >>= b; return a; }
43 u64 u64u64(u64 a, u64 b) { a >>= b; return a; }
46 * check-name: shift-assign1
47 * check-command: test-linearize -Wno-decl $file
49 * check-output-start
50 s16s16:
51 .L0:
52 <entry-point>
53 sext.32 %r2 <- (16) %arg2
54 sext.32 %r4 <- (16) %arg1
55 asr.32 %r5 <- %r4, %r2
56 trunc.16 %r6 <- (32) %r5
57 ret.16 %r6
60 s16s32:
61 .L2:
62 <entry-point>
63 sext.32 %r11 <- (16) %arg1
64 asr.32 %r12 <- %r11, %arg2
65 trunc.16 %r13 <- (32) %r12
66 ret.16 %r13
69 s16s64:
70 .L4:
71 <entry-point>
72 trunc.32 %r17 <- (64) %arg2
73 sext.32 %r19 <- (16) %arg1
74 asr.32 %r20 <- %r19, %r17
75 trunc.16 %r21 <- (32) %r20
76 ret.16 %r21
79 s16u16:
80 .L6:
81 <entry-point>
82 zext.32 %r25 <- (16) %arg2
83 sext.32 %r27 <- (16) %arg1
84 asr.32 %r28 <- %r27, %r25
85 trunc.16 %r29 <- (32) %r28
86 ret.16 %r29
89 s16u32:
90 .L8:
91 <entry-point>
92 sext.32 %r34 <- (16) %arg1
93 asr.32 %r35 <- %r34, %arg2
94 trunc.16 %r36 <- (32) %r35
95 ret.16 %r36
98 s16u64:
99 .L10:
100 <entry-point>
101 trunc.32 %r40 <- (64) %arg2
102 sext.32 %r42 <- (16) %arg1
103 asr.32 %r43 <- %r42, %r40
104 trunc.16 %r44 <- (32) %r43
105 ret.16 %r44
108 s32s16:
109 .L12:
110 <entry-point>
111 sext.32 %r48 <- (16) %arg2
112 asr.32 %r50 <- %arg1, %r48
113 ret.32 %r50
116 s32s32:
117 .L14:
118 <entry-point>
119 asr.32 %r55 <- %arg1, %arg2
120 ret.32 %r55
123 s32s64:
124 .L16:
125 <entry-point>
126 trunc.32 %r59 <- (64) %arg2
127 asr.32 %r61 <- %arg1, %r59
128 ret.32 %r61
131 s32u16:
132 .L18:
133 <entry-point>
134 zext.32 %r65 <- (16) %arg2
135 asr.32 %r67 <- %arg1, %r65
136 ret.32 %r67
139 s32u32:
140 .L20:
141 <entry-point>
142 asr.32 %r72 <- %arg1, %arg2
143 ret.32 %r72
146 s32u64:
147 .L22:
148 <entry-point>
149 trunc.32 %r76 <- (64) %arg2
150 asr.32 %r78 <- %arg1, %r76
151 ret.32 %r78
154 s64s64:
155 .L24:
156 <entry-point>
157 asr.64 %r83 <- %arg1, %arg2
158 ret.64 %r83
161 s64u16:
162 .L26:
163 <entry-point>
164 zext.64 %r88 <- (16) %arg2
165 asr.64 %r90 <- %arg1, %r88
166 ret.64 %r90
169 s64u32:
170 .L28:
171 <entry-point>
172 zext.64 %r94 <- (32) %arg2
173 asr.64 %r96 <- %arg1, %r94
174 ret.64 %r96
177 s64u64:
178 .L30:
179 <entry-point>
180 asr.64 %r101 <- %arg1, %arg2
181 ret.64 %r101
184 u16s16:
185 .L32:
186 <entry-point>
187 sext.32 %r105 <- (16) %arg2
188 zext.32 %r107 <- (16) %arg1
189 asr.32 %r108 <- %r107, %r105
190 trunc.16 %r109 <- (32) %r108
191 ret.16 %r109
194 u16s32:
195 .L34:
196 <entry-point>
197 zext.32 %r114 <- (16) %arg1
198 asr.32 %r115 <- %r114, %arg2
199 trunc.16 %r116 <- (32) %r115
200 ret.16 %r116
203 u16s64:
204 .L36:
205 <entry-point>
206 trunc.32 %r120 <- (64) %arg2
207 zext.32 %r122 <- (16) %arg1
208 asr.32 %r123 <- %r122, %r120
209 trunc.16 %r124 <- (32) %r123
210 ret.16 %r124
213 u16u16:
214 .L38:
215 <entry-point>
216 zext.32 %r128 <- (16) %arg2
217 zext.32 %r130 <- (16) %arg1
218 asr.32 %r131 <- %r130, %r128
219 trunc.16 %r132 <- (32) %r131
220 ret.16 %r132
223 u16u32:
224 .L40:
225 <entry-point>
226 zext.32 %r137 <- (16) %arg1
227 asr.32 %r138 <- %r137, %arg2
228 trunc.16 %r139 <- (32) %r138
229 ret.16 %r139
232 u16u64:
233 .L42:
234 <entry-point>
235 trunc.32 %r143 <- (64) %arg2
236 zext.32 %r145 <- (16) %arg1
237 asr.32 %r146 <- %r145, %r143
238 trunc.16 %r147 <- (32) %r146
239 ret.16 %r147
242 u32s16:
243 .L44:
244 <entry-point>
245 sext.32 %r151 <- (16) %arg2
246 lsr.32 %r153 <- %arg1, %r151
247 ret.32 %r153
250 u32s32:
251 .L46:
252 <entry-point>
253 lsr.32 %r158 <- %arg1, %arg2
254 ret.32 %r158
257 u32s64:
258 .L48:
259 <entry-point>
260 trunc.32 %r162 <- (64) %arg2
261 lsr.32 %r164 <- %arg1, %r162
262 ret.32 %r164
265 u32u16:
266 .L50:
267 <entry-point>
268 zext.32 %r168 <- (16) %arg2
269 lsr.32 %r170 <- %arg1, %r168
270 ret.32 %r170
273 u32u32:
274 .L52:
275 <entry-point>
276 lsr.32 %r175 <- %arg1, %arg2
277 ret.32 %r175
280 u32u64:
281 .L54:
282 <entry-point>
283 trunc.32 %r179 <- (64) %arg2
284 lsr.32 %r181 <- %arg1, %r179
285 ret.32 %r181
288 u64s64:
289 .L56:
290 <entry-point>
291 lsr.64 %r186 <- %arg1, %arg2
292 ret.64 %r186
295 u64u16:
296 .L58:
297 <entry-point>
298 zext.64 %r191 <- (16) %arg2
299 lsr.64 %r193 <- %arg1, %r191
300 ret.64 %r193
303 u64u32:
304 .L60:
305 <entry-point>
306 zext.64 %r197 <- (32) %arg2
307 lsr.64 %r199 <- %arg1, %r197
308 ret.64 %r199
311 u64u64:
312 .L62:
313 <entry-point>
314 lsr.64 %r204 <- %arg1, %arg2
315 ret.64 %r204
318 * check-output-end