xref: /illumos-gate/usr/src/tools/smatch/src/validation/linear/fp2i-cast.c (revision eb00b1c8a31c2253a353644606388dff5b0e0275)
1 #if __SIZEOF_INT__ == __SIZEOF_FLOAT__
2 typedef   signed int si;
3 typedef unsigned int ui;
4 #else
5 #error "no float-sized integer type"
6 #endif
7 
8 #if __SIZEOF_LONG_LONG__ == __SIZEOF_DOUBLE__
9 typedef   signed long long sl;
10 typedef unsigned long long ul;
11 #else
12 #error "no double-sized integer type"
13 #endif
14 
15 si f2si(float  a) { return a; }
16 ui f2ui(float  a) { return a; }
17 sl f2sl(float  a) { return a; }
18 ul f2ul(float  a) { return a; }
19 si d2si(double a) { return a; }
20 ui d2ui(double a) { return a; }
21 sl d2sl(double a) { return a; }
22 ul d2ul(double a) { return a; }
23 
24 /*
25  * check-name: fp2i cast
26  * check-command: test-linearize -Wno-decl $file
27  *
28  * check-output-ignore
29  * check-output-pattern(4): fcvts\\.
30  * check-output-pattern(4): fcvtu\\.
31  */
32