PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / divcmp-2.c
blobb059b8fbaecfae4644cdfcb010a6620c2915bef1
1 extern void abort (void);
3 int test1(int x)
5 return x/10 == 2;
8 int test2(int x)
10 return x/10 == 0;
13 int test3(int x)
15 return x/10 == -2;
18 int test4(int x)
20 return x/-10 == 2;
23 int test5(int x)
25 return x/-10 == 0;
28 int test6(int x)
30 return x/-10 == -2;
34 int main()
36 if (test1(19) != 0)
37 abort ();
38 if (test1(20) != 1)
39 abort ();
40 if (test1(29) != 1)
41 abort ();
42 if (test1(30) != 0)
43 abort ();
45 if (test2(-10) != 0)
46 abort ();
47 if (test2(-9) != 1)
48 abort ();
49 if (test2(9) != 1)
50 abort ();
51 if (test2(10) != 0)
52 abort ();
54 if (test3(-30) != 0)
55 abort ();
56 if (test3(-29) != 1)
57 abort ();
58 if (test3(-20) != 1)
59 abort ();
60 if (test3(-19) != 0)
61 abort ();
63 if (test4(-30) != 0)
64 abort ();
65 if (test4(-29) != 1)
66 abort ();
67 if (test4(-20) != 1)
68 abort ();
69 if (test4(-19) != 0)
70 abort ();
72 if (test5(-10) != 0)
73 abort ();
74 if (test5(-9) != 1)
75 abort ();
76 if (test5(9) != 1)
77 abort ();
78 if (test5(10) != 0)
79 abort ();
81 if (test6(19) != 0)
82 abort ();
83 if (test6(20) != 1)
84 abort ();
85 if (test6(29) != 1)
86 abort ();
87 if (test6(30) != 0)
88 abort ();
90 return 0;