struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-divcmp-2.c
blob5f4c4cb95cbbc3463c58b299de024fd69535bd72
1 /*
2 divcmp-2.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(int x)
13 return x/10 == 2;
16 int test2(int x)
18 return x/10 == 0;
21 int test3(int x)
23 return x/10 == -2;
26 int test4(int x)
28 return x/-10 == 2;
31 int test5(int x)
33 return x/-10 == 0;
36 int test6(int x)
38 return x/-10 == -2;
41 void
42 testTortureExecute (void)
44 if (test1(19) != 0)
45 ASSERT (0);
46 if (test1(20) != 1)
47 ASSERT (0);
48 if (test1(29) != 1)
49 ASSERT (0);
50 if (test1(30) != 0)
51 ASSERT (0);
53 if (test2(-10) != 0)
54 ASSERT (0);
55 if (test2(-9) != 1)
56 ASSERT (0);
57 if (test2(9) != 1)
58 ASSERT (0);
59 if (test2(10) != 0)
60 ASSERT (0);
62 if (test3(-30) != 0)
63 ASSERT (0);
64 if (test3(-29) != 1)
65 ASSERT (0);
66 if (test3(-20) != 1)
67 ASSERT (0);
68 if (test3(-19) != 0)
69 ASSERT (0);
71 if (test4(-30) != 0)
72 ASSERT (0);
73 if (test4(-29) != 1)
74 ASSERT (0);
75 if (test4(-20) != 1)
76 ASSERT (0);
77 if (test4(-19) != 0)
78 ASSERT (0);
80 if (test5(-10) != 0)
81 ASSERT (0);
82 if (test5(-9) != 1)
83 ASSERT (0);
84 if (test5(9) != 1)
85 ASSERT (0);
86 if (test5(10) != 0)
87 ASSERT (0);
89 if (test6(19) != 0)
90 ASSERT (0);
91 if (test6(20) != 1)
92 ASSERT (0);
93 if (test6(29) != 1)
94 ASSERT (0);
95 if (test6(30) != 0)
96 ASSERT (0);
98 return;