struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-tstdi-1.c
blob33beb839c85b8c5ce626ceaece77d17e569eb7cd
1 /*
2 tstdi-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #define FALSE 140
8 #define TRUE 13
9 #if 0 // TODO: enable when SDCC supports K&R-style
10 feq (x)
11 long long int x;
13 if (x == 0)
14 return TRUE;
15 else
16 return FALSE;
19 fne (x)
20 long long int x;
22 if (x != 0)
23 return TRUE;
24 else
25 return FALSE;
28 flt (x)
29 long long int x;
31 if (x < 0)
32 return TRUE;
33 else
34 return FALSE;
37 fge (x)
38 long long int x;
40 if (x >= 0)
41 return TRUE;
42 else
43 return FALSE;
46 fgt (x)
47 long long int x;
49 if (x > 0)
50 return TRUE;
51 else
52 return FALSE;
55 fle (x)
56 long long int x;
58 if (x <= 0)
59 return TRUE;
60 else
61 return FALSE;
63 #endif
64 void
65 testTortureExecute (void)
67 #if 0
68 if (feq (0LL) != TRUE)
69 abort ();
70 if (feq (-1LL) != FALSE)
71 abort ();
72 if (feq (0x8000000000000000LL) != FALSE)
73 abort ();
74 if (feq (0x8000000000000001LL) != FALSE)
75 abort ();
76 if (feq (1LL) != FALSE)
77 abort ();
78 if (feq (0x7fffffffffffffffLL) != FALSE)
79 abort ();
81 if (fne (0LL) != FALSE)
82 abort ();
83 if (fne (-1LL) != TRUE)
84 abort ();
85 if (fne (0x8000000000000000LL) != TRUE)
86 abort ();
87 if (fne (0x8000000000000001LL) != TRUE)
88 abort ();
89 if (fne (1LL) != TRUE)
90 abort ();
91 if (fne (0x7fffffffffffffffLL) != TRUE)
92 abort ();
94 if (flt (0LL) != FALSE)
95 abort ();
96 if (flt (-1LL) != TRUE)
97 abort ();
98 if (flt (0x8000000000000000LL) != TRUE)
99 abort ();
100 if (flt (0x8000000000000001LL) != TRUE)
101 abort ();
102 if (flt (1LL) != FALSE)
103 abort ();
104 if (flt (0x7fffffffffffffffLL) != FALSE)
105 abort ();
107 if (fge (0LL) != TRUE)
108 abort ();
109 if (fge (-1LL) != FALSE)
110 abort ();
111 if (fge (0x8000000000000000LL) != FALSE)
112 abort ();
113 if (fge (0x8000000000000001LL) != FALSE)
114 abort ();
115 if (fge (1LL) != TRUE)
116 abort ();
117 if (fge (0x7fffffffffffffffLL) != TRUE)
118 abort ();
120 if (fgt (0LL) != FALSE)
121 abort ();
122 if (fgt (-1LL) != FALSE)
123 abort ();
124 if (fgt (0x8000000000000000LL) != FALSE)
125 abort ();
126 if (fgt (0x8000000000000001LL) != FALSE)
127 abort ();
128 if (fgt (1LL) != TRUE)
129 abort ();
130 if (fgt (0x7fffffffffffffffLL) != TRUE)
131 abort ();
133 if (fle (0LL) != TRUE)
134 abort ();
135 if (fle (-1LL) != TRUE)
136 abort ();
137 if (fle (0x8000000000000000LL) != TRUE)
138 abort ();
139 if (fle (0x8000000000000001LL) != TRUE)
140 abort ();
141 if (fle (1LL) != FALSE)
142 abort ();
143 if (fle (0x7fffffffffffffffLL) != FALSE)
144 abort ();
145 #endif
146 return;