Rebase.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr27302-2.c
blob5c201b3d2ddae1030c9e7881ed09ae9da4be81e4
1 /* { dg-do run } */
2 /* { dg-options "-fstrict-overflow" } */
4 extern void link_error (void);
6 void test0 (int a, int b)
8 if ((a < b) != (b > a))
9 link_error ();
11 if ((a - 1 < b) != (a <= b))
12 link_error ();
13 if ((a - 2 < b) != (a - 1 <= b))
14 link_error ();
15 if ((a + -1 < b) != (a <= b))
16 link_error ();
17 if ((a + -2 < b) != (a + -1 <= b))
18 link_error ();
20 if ((a + 1 > b) != (a >= b))
21 link_error ();
22 if ((a + 2 > b) != (a + 1 >= b))
23 link_error ();
24 if ((a - -1 > b) != (a >= b))
25 link_error ();
26 if ((a - -2 > b) != (a - -1 >= b))
27 link_error ();
29 if ((a + 1 <= b) != (a < b))
30 link_error ();
31 if ((a + 2 <= b) != (a + 1 < b))
32 link_error ();
33 if ((a - -1 <= b) != (a < b))
34 link_error ();
35 if ((a - -2 <= b) != (a - -1 < b))
36 link_error ();
38 if ((a - 1 >= b) != (a > b))
39 link_error ();
40 if ((a - 2 >= b) != (a - 1 > b))
41 link_error ();
42 if ((a + -1 >= b) != (a > b))
43 link_error ();
44 if ((a + -2 >= b) != (a + -1 > b))
45 link_error ();
48 int main()
50 test0 (1, 2);
51 return 0;