PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / divcmp-4.c
blobebc09a10e3981e89e2f98a6778bf3f1c42f41e32
1 /* PR middle-end/17894 */
3 extern void abort(void);
5 int test1(int x)
7 return x/-10 == 2;
10 int test2(int x)
12 return x/-10 == 0;
15 int test3(int x)
17 return x/-10 != 2;
20 int test4(int x)
22 return x/-10 != 0;
25 int test5(int x)
27 return x/-10 < 2;
30 int test6(int x)
32 return x/-10 < 0;
35 int test7(int x)
37 return x/-10 <= 2;
40 int test8(int x)
42 return x/-10 <= 0;
45 int test9(int x)
47 return x/-10 > 2;
50 int test10(int x)
52 return x/-10 > 0;
55 int test11(int x)
57 return x/-10 >= 2;
60 int test12(int x)
62 return x/-10 >= 0;
66 int main()
68 if (test1(-30) != 0)
69 abort ();
70 if (test1(-29) != 1)
71 abort ();
72 if (test1(-20) != 1)
73 abort ();
74 if (test1(-19) != 0)
75 abort ();
77 if (test2(0) != 1)
78 abort ();
79 if (test2(9) != 1)
80 abort ();
81 if (test2(10) != 0)
82 abort ();
83 if (test2(-1) != 1)
84 abort ();
85 if (test2(-9) != 1)
86 abort ();
87 if (test2(-10) != 0)
88 abort ();
90 if (test3(-30) != 1)
91 abort ();
92 if (test3(-29) != 0)
93 abort ();
94 if (test3(-20) != 0)
95 abort ();
96 if (test3(-19) != 1)
97 abort ();
99 if (test4(0) != 0)
100 abort ();
101 if (test4(9) != 0)
102 abort ();
103 if (test4(10) != 1)
104 abort ();
105 if (test4(-1) != 0)
106 abort ();
107 if (test4(-9) != 0)
108 abort ();
109 if (test4(-10) != 1)
110 abort ();
112 if (test5(-30) != 0)
113 abort ();
114 if (test5(-29) != 0)
115 abort ();
116 if (test5(-20) != 0)
117 abort ();
118 if (test5(-19) != 1)
119 abort ();
121 if (test6(0) != 0)
122 abort ();
123 if (test6(9) != 0)
124 abort ();
125 if (test6(10) != 1)
126 abort ();
127 if (test6(-1) != 0)
128 abort ();
129 if (test6(-9) != 0)
130 abort ();
131 if (test6(-10) != 0)
132 abort ();
134 if (test7(-30) != 0)
135 abort ();
136 if (test7(-29) != 1)
137 abort ();
138 if (test7(-20) != 1)
139 abort ();
140 if (test7(-19) != 1)
141 abort ();
143 if (test8(0) != 1)
144 abort ();
145 if (test8(9) != 1)
146 abort ();
147 if (test8(10) != 1)
148 abort ();
149 if (test8(-1) != 1)
150 abort ();
151 if (test8(-9) != 1)
152 abort ();
153 if (test8(-10) != 0)
154 abort ();
156 if (test9(-30) != 1)
157 abort ();
158 if (test9(-29) != 0)
159 abort ();
160 if (test9(-20) != 0)
161 abort ();
162 if (test9(-19) != 0)
163 abort ();
165 if (test10(0) != 0)
166 abort ();
167 if (test10(9) != 0)
168 abort ();
169 if (test10(10) != 0)
170 abort ();
171 if (test10(-1) != 0)
172 abort ();
173 if (test10(-9) != 0)
174 abort ();
175 if (test10(-10) != 1)
176 abort ();
178 if (test11(-30) != 1)
179 abort ();
180 if (test11(-29) != 1)
181 abort ();
182 if (test11(-20) != 1)
183 abort ();
184 if (test11(-19) != 0)
185 abort ();
187 if (test12(0) != 1)
188 abort ();
189 if (test12(9) != 1)
190 abort ();
191 if (test12(10) != 0)
192 abort ();
193 if (test12(-1) != 1)
194 abort ();
195 if (test12(-9) != 1)
196 abort ();
197 if (test12(-10) != 1)
198 abort ();
200 return 0;