1/* { dg-do compile } */
2/* { dg-options "-O2 -fdump-tree-cfg" } */
3
4#include <limits.h>
5
6void this_comparison_is_false (void);
7void this_comparison_is_true (void);
8void this_comparison_is_not_decidable (void);
9
10void bla1eq (int var)
11{
12  if (var + 10 == INT_MIN + 9)
13    this_comparison_is_false ();
14}
15
16void bla2eq (int var)
17{
18  if (var + 10 == INT_MIN + 10)
19    this_comparison_is_not_decidable ();
20}
21
22void bla3eq (int var)
23{
24  if (var - 10 == INT_MAX - 9)
25    this_comparison_is_false ();
26}
27
28void bla4eq (int var)
29{
30  if (var - 10 == INT_MAX - 10)
31    this_comparison_is_not_decidable ();
32}
33
34void bla1ne (int var)
35{
36  if (var + 10 != INT_MIN + 9)
37    this_comparison_is_true ();
38}
39
40void bla2ne (int var)
41{
42  if (var + 10 != INT_MIN + 10)
43    this_comparison_is_not_decidable ();
44}
45
46void bla3ne (int var)
47{
48  if (var - 10 != INT_MAX - 9)
49    this_comparison_is_true ();
50}
51
52void bla4ne (int var)
53{
54  if (var - 10 != INT_MAX - 10)
55    this_comparison_is_not_decidable ();
56}
57
58void bla1lt (int var)
59{
60  if (var + 10 < INT_MIN + 10)
61    this_comparison_is_false ();
62}
63
64void bla2lt (int var)
65{
66  if (var + 10 < INT_MIN + 11)
67    this_comparison_is_not_decidable ();
68}
69
70void bla3lt (int var)
71{
72  if (var - 10 < INT_MAX - 9)
73    this_comparison_is_true ();
74}
75
76void bla4lt (int var)
77{
78  if (var - 10 < INT_MAX - 10)
79    this_comparison_is_not_decidable ();
80}
81
82void bla1le (int var)
83{
84  if (var + 10 <= INT_MIN + 9)
85    this_comparison_is_false ();
86}
87
88void bla2le (int var)
89{
90  if (var + 10 <= INT_MIN + 10)
91    this_comparison_is_not_decidable ();
92}
93
94void bla3le (int var)
95{
96  if (var - 10 <= INT_MAX - 10)
97    this_comparison_is_true ();
98}
99
100void bla4le (int var)
101{
102  if (var - 10 <= INT_MAX - 11)
103    this_comparison_is_not_decidable ();
104}
105
106void bla1gt (int var)
107{
108  if (var + 10 > INT_MIN + 9)
109    this_comparison_is_true ();
110}
111
112void bla2gt (int var)
113{
114  if (var + 10 > INT_MIN + 10)
115    this_comparison_is_not_decidable ();
116}
117
118void bla3gt (int var)
119{
120  if (var - 10 > INT_MAX - 10)
121    this_comparison_is_false ();
122}
123
124void bla4gt (int var)
125{
126  if (var - 10 > INT_MAX - 11)
127    this_comparison_is_not_decidable ();
128}
129
130void bla1ge (int var)
131{
132  if (var + 10 >= INT_MIN + 10)
133    this_comparison_is_true ();
134}
135
136void bla2ge (int var)
137{
138  if (var + 10 >= INT_MIN + 11)
139    this_comparison_is_not_decidable ();
140}
141
142void bla3ge (int var)
143{
144  if (var - 11 >= INT_MAX - 10)
145    this_comparison_is_false ();
146}
147
148void bla4ge (int var)
149{
150  if (var - 10 >= INT_MAX - 10)
151    this_comparison_is_not_decidable ();
152}
153
154/* { dg-final { scan-tree-dump-times "this_comparison_is_false" 0 "cfg" } } */
155/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cfg" } } */
156/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cfg" } } */
157/* { dg-final { scan-tree-dump-times "if " 12 "cfg" } } */
158
159/* { dg-final { cleanup-tree-dump "cfg" } } */
160