struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-divcmp-3.c
blob6e242e55fdfdcc59ab906a6cdf916eaa3f940c7a
1 /*
2 divcmp-3.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 int test1(char x)
13 return x/100 == 3;
16 int test1u(unsigned char x)
18 return x/100 == 3;
21 int test2(char x)
23 return x/100 != 3;
26 int test2u(unsigned char x)
28 return x/100 != 3;
31 int test3(char x)
33 return x/100 < 3;
36 int test3u(unsigned char x)
38 return x/100 < 3;
41 int test4(char x)
43 return x/100 <= 3;
46 int test4u(unsigned char x)
48 return x/100 <= 3;
51 int test5(char x)
53 return x/100 > 3;
56 int test5u(unsigned char x)
58 return x/100 > 3;
61 int test6(char x)
63 return x/100 >= 3;
66 int test6u(unsigned char x)
68 return x/100 >= 3;
71 void
72 testTortureExecute (void)
74 int c;
76 for (c=-128; c<256; c++)
78 if (test1(c) != 0)
79 ASSERT (0);
80 if (test1u(c) != 0)
81 ASSERT (0);
82 if (test2(c) != 1)
83 ASSERT (0);
84 if (test2u(c) != 1)
85 ASSERT (0);
86 if (test3(c) != 1)
87 ASSERT (0);
88 if (test3u(c) != 1)
89 ASSERT (0);
90 if (test4(c) != 1)
91 ASSERT (0);
92 if (test4u(c) != 1)
93 ASSERT (0);
94 if (test5(c) != 0)
95 ASSERT (0);
96 if (test5u(c) != 0)
97 ASSERT (0);
98 if (test6(c) != 0)
99 ASSERT (0);
100 if (test6u(c) != 0)
101 ASSERT (0);
103 return;