db/fixup_kernel.sh: commit all my stuff
[smatch.git] / validation / cast-kinds.c
blob697f9735ea7596b7a1e9ab6d0ff5361024115d53
1 typedef unsigned int uint;
2 typedef unsigned long ulong;
4 static int uint_2_int(uint a) { return (int)a; }
5 static int long_2_int(long a) { return (int)a; }
6 static int ulong_2_int(ulong a) { return (int)a; }
7 static int vptr_2_int(void *a) { return (int)a; }
8 static int iptr_2_int(int *a) { return (int)a; }
9 static int float_2_int(float a) { return (int)a; }
10 static int double_2_int(double a) { return (int)a; }
11 static uint int_2_uint(int a) { return (uint)a; }
12 static uint long_2_uint(long a) { return (uint)a; }
13 static uint ulong_2_uint(ulong a) { return (uint)a; }
14 static uint vptr_2_uint(void *a) { return (uint)a; }
15 static uint iptr_2_uint(int *a) { return (uint)a; }
16 static uint float_2_uint(float a) { return (uint)a; }
17 static uint double_2_uint(double a) { return (uint)a; }
18 static long int_2_long(int a) { return (long)a; }
19 static long uint_2_long(uint a) { return (long)a; }
20 static long ulong_2_long(ulong a) { return (long)a; }
21 static long vptr_2_long(void *a) { return (long)a; }
22 static long iptr_2_long(int *a) { return (long)a; }
23 static long float_2_long(float a) { return (long)a; }
24 static long double_2_long(double a) { return (long)a; }
25 static ulong int_2_ulong(int a) { return (ulong)a; }
26 static ulong uint_2_ulong(uint a) { return (ulong)a; }
27 static ulong long_2_ulong(long a) { return (ulong)a; }
28 static ulong vptr_2_ulong(void *a) { return (ulong)a; }
29 static ulong iptr_2_ulong(int *a) { return (ulong)a; }
30 static ulong float_2_ulong(float a) { return (ulong)a; }
31 static ulong double_2_ulong(double a) { return (ulong)a; }
32 static void * int_2_vptr(int a) { return (void *)a; }
33 static void * uint_2_vptr(uint a) { return (void *)a; }
34 static void * long_2_vptr(long a) { return (void *)a; }
35 static void * ulong_2_vptr(ulong a) { return (void *)a; }
36 static void * iptr_2_vptr(int *a) { return (void *)a; }
37 static int * int_2_iptr(int a) { return (int *)a; }
38 static int * uint_2_iptr(uint a) { return (int *)a; }
39 static int * long_2_iptr(long a) { return (int *)a; }
40 static int * ulong_2_iptr(ulong a) { return (int *)a; }
41 static int * vptr_2_iptr(void *a) { return (int *)a; }
42 static float int_2_float(int a) { return (float)a; }
43 static float uint_2_float(uint a) { return (float)a; }
44 static float long_2_float(long a) { return (float)a; }
45 static float ulong_2_float(ulong a) { return (float)a; }
46 static float double_2_float(double a) { return (float)a; }
47 static double int_2_double(int a) { return (double)a; }
48 static double uint_2_double(uint a) { return (double)a; }
49 static double long_2_double(long a) { return (double)a; }
50 static double ulong_2_double(ulong a) { return (double)a; }
51 static double float_2_double(float a) { return (double)a; }
54 * check-name: cast-kinds
55 * check-command: test-linearize -m64 $file
57 * check-output-start
58 uint_2_int:
59 .L0:
60 <entry-point>
61 ret.32 %arg1
64 long_2_int:
65 .L2:
66 <entry-point>
67 scast.32 %r5 <- (64) %arg1
68 ret.32 %r5
71 ulong_2_int:
72 .L4:
73 <entry-point>
74 cast.32 %r8 <- (64) %arg1
75 ret.32 %r8
78 vptr_2_int:
79 .L6:
80 <entry-point>
81 cast.32 %r11 <- (64) %arg1
82 ret.32 %r11
85 iptr_2_int:
86 .L8:
87 <entry-point>
88 cast.32 %r14 <- (64) %arg1
89 ret.32 %r14
92 float_2_int:
93 .L10:
94 <entry-point>
95 ret.32 %arg1
98 double_2_int:
99 .L12:
100 <entry-point>
101 cast.32 %r20 <- (64) %arg1
102 ret.32 %r20
105 int_2_uint:
106 .L14:
107 <entry-point>
108 ret.32 %arg1
111 long_2_uint:
112 .L16:
113 <entry-point>
114 scast.32 %r26 <- (64) %arg1
115 ret.32 %r26
118 ulong_2_uint:
119 .L18:
120 <entry-point>
121 cast.32 %r29 <- (64) %arg1
122 ret.32 %r29
125 vptr_2_uint:
126 .L20:
127 <entry-point>
128 cast.32 %r32 <- (64) %arg1
129 ret.32 %r32
132 iptr_2_uint:
133 .L22:
134 <entry-point>
135 cast.32 %r35 <- (64) %arg1
136 ret.32 %r35
139 float_2_uint:
140 .L24:
141 <entry-point>
142 ret.32 %arg1
145 double_2_uint:
146 .L26:
147 <entry-point>
148 cast.32 %r41 <- (64) %arg1
149 ret.32 %r41
152 int_2_long:
153 .L28:
154 <entry-point>
155 scast.64 %r44 <- (32) %arg1
156 ret.64 %r44
159 uint_2_long:
160 .L30:
161 <entry-point>
162 cast.64 %r47 <- (32) %arg1
163 ret.64 %r47
166 ulong_2_long:
167 .L32:
168 <entry-point>
169 ret.64 %arg1
172 vptr_2_long:
173 .L34:
174 <entry-point>
175 cast.64 %r53 <- (64) %arg1
176 ret.64 %r53
179 iptr_2_long:
180 .L36:
181 <entry-point>
182 cast.64 %r56 <- (64) %arg1
183 ret.64 %r56
186 float_2_long:
187 .L38:
188 <entry-point>
189 cast.64 %r59 <- (32) %arg1
190 ret.64 %r59
193 double_2_long:
194 .L40:
195 <entry-point>
196 ret.64 %arg1
199 int_2_ulong:
200 .L42:
201 <entry-point>
202 scast.64 %r65 <- (32) %arg1
203 ret.64 %r65
206 uint_2_ulong:
207 .L44:
208 <entry-point>
209 cast.64 %r68 <- (32) %arg1
210 ret.64 %r68
213 long_2_ulong:
214 .L46:
215 <entry-point>
216 ret.64 %arg1
219 vptr_2_ulong:
220 .L48:
221 <entry-point>
222 cast.64 %r74 <- (64) %arg1
223 ret.64 %r74
226 iptr_2_ulong:
227 .L50:
228 <entry-point>
229 cast.64 %r77 <- (64) %arg1
230 ret.64 %r77
233 float_2_ulong:
234 .L52:
235 <entry-point>
236 cast.64 %r80 <- (32) %arg1
237 ret.64 %r80
240 double_2_ulong:
241 .L54:
242 <entry-point>
243 ret.64 %arg1
246 int_2_vptr:
247 .L56:
248 <entry-point>
249 scast.64 %r86 <- (32) %arg1
250 ret.64 %r86
253 uint_2_vptr:
254 .L58:
255 <entry-point>
256 cast.64 %r89 <- (32) %arg1
257 ret.64 %r89
260 long_2_vptr:
261 .L60:
262 <entry-point>
263 scast.64 %r92 <- (64) %arg1
264 ret.64 %r92
267 ulong_2_vptr:
268 .L62:
269 <entry-point>
270 cast.64 %r95 <- (64) %arg1
271 ret.64 %r95
274 iptr_2_vptr:
275 .L64:
276 <entry-point>
277 cast.64 %r98 <- (64) %arg1
278 ret.64 %r98
281 int_2_iptr:
282 .L66:
283 <entry-point>
284 ptrcast.64 %r101 <- (32) %arg1
285 ret.64 %r101
288 uint_2_iptr:
289 .L68:
290 <entry-point>
291 ptrcast.64 %r104 <- (32) %arg1
292 ret.64 %r104
295 long_2_iptr:
296 .L70:
297 <entry-point>
298 ptrcast.64 %r107 <- (64) %arg1
299 ret.64 %r107
302 ulong_2_iptr:
303 .L72:
304 <entry-point>
305 ptrcast.64 %r110 <- (64) %arg1
306 ret.64 %r110
309 vptr_2_iptr:
310 .L74:
311 <entry-point>
312 ptrcast.64 %r113 <- (64) %arg1
313 ret.64 %r113
316 int_2_float:
317 .L76:
318 <entry-point>
319 fpcast.32 %r116 <- (32) %arg1
320 ret.32 %r116
323 uint_2_float:
324 .L78:
325 <entry-point>
326 fpcast.32 %r119 <- (32) %arg1
327 ret.32 %r119
330 long_2_float:
331 .L80:
332 <entry-point>
333 fpcast.32 %r122 <- (64) %arg1
334 ret.32 %r122
337 ulong_2_float:
338 .L82:
339 <entry-point>
340 fpcast.32 %r125 <- (64) %arg1
341 ret.32 %r125
344 double_2_float:
345 .L84:
346 <entry-point>
347 fpcast.32 %r128 <- (64) %arg1
348 ret.32 %r128
351 int_2_double:
352 .L86:
353 <entry-point>
354 fpcast.64 %r131 <- (32) %arg1
355 ret.64 %r131
358 uint_2_double:
359 .L88:
360 <entry-point>
361 fpcast.64 %r134 <- (32) %arg1
362 ret.64 %r134
365 long_2_double:
366 .L90:
367 <entry-point>
368 fpcast.64 %r137 <- (64) %arg1
369 ret.64 %r137
372 ulong_2_double:
373 .L92:
374 <entry-point>
375 fpcast.64 %r140 <- (64) %arg1
376 ret.64 %r140
379 float_2_double:
380 .L94:
381 <entry-point>
382 fpcast.64 %r143 <- (32) %arg1
383 ret.64 %r143
386 * check-output-end