aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-3.c
blob: d38a945aeec27e4248be540f4195040199f2a290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-cfg" } */

#include <limits.h>

void this_comparison_is_false (void);
void this_comparison_is_true (void);
void this_comparison_is_not_decidable (void);

void bla1eq (int var)
{
  if (var + 10 == INT_MIN + 9)
    this_comparison_is_false ();
}

void bla2eq (int var)
{
  if (var + 10 == INT_MIN + 10)
    this_comparison_is_not_decidable ();
}

void bla3eq (int var)
{
  if (var - 10 == INT_MAX - 9)
    this_comparison_is_false ();
}

void bla4eq (int var)
{
  if (var - 10 == INT_MAX - 10)
    this_comparison_is_not_decidable ();
}

void bla1ne (int var)
{
  if (var + 10 != INT_MIN + 9)
    this_comparison_is_true ();
}

void bla2ne (int var)
{
  if (var + 10 != INT_MIN + 10)
    this_comparison_is_not_decidable ();
}

void bla3ne (int var)
{
  if (var - 10 != INT_MAX - 9)
    this_comparison_is_true ();
}

void bla4ne (int var)
{
  if (var - 10 != INT_MAX - 10)
    this_comparison_is_not_decidable ();
}

void bla1lt (int var)
{
  if (var + 10 < INT_MIN + 10)
    this_comparison_is_false ();
}

void bla2lt (int var)
{
  if (var + 10 < INT_MIN + 11)
    this_comparison_is_not_decidable ();
}

void bla3lt (int var)
{
  if (var - 10 < INT_MAX - 9)
    this_comparison_is_true ();
}

void bla4lt (int var)
{
  if (var - 10 < INT_MAX - 10)
    this_comparison_is_not_decidable ();
}

void bla1le (int var)
{
  if (var + 10 <= INT_MIN + 9)
    this_comparison_is_false ();
}

void bla2le (int var)
{
  if (var + 10 <= INT_MIN + 10)
    this_comparison_is_not_decidable ();
}

void bla3le (int var)
{
  if (var - 10 <= INT_MAX - 10)
    this_comparison_is_true ();
}

void bla4le (int var)
{
  if (var - 10 <= INT_MAX - 11)
    this_comparison_is_not_decidable ();
}

void bla1gt (int var)
{
  if (var + 10 > INT_MIN + 9)
    this_comparison_is_true ();
}

void bla2gt (int var)
{
  if (var + 10 > INT_MIN + 10)
    this_comparison_is_not_decidable ();
}

void bla3gt (int var)
{
  if (var - 10 > INT_MAX - 10)
    this_comparison_is_false ();
}

void bla4gt (int var)
{
  if (var - 10 > INT_MAX - 11)
    this_comparison_is_not_decidable ();
}

void bla1ge (int var)
{
  if (var + 10 >= INT_MIN + 10)
    this_comparison_is_true ();
}

void bla2ge (int var)
{
  if (var + 10 >= INT_MIN + 11)
    this_comparison_is_not_decidable ();
}

void bla3ge (int var)
{
  if (var - 11 >= INT_MAX - 10)
    this_comparison_is_false ();
}

void bla4ge (int var)
{
  if (var - 10 >= INT_MAX - 10)
    this_comparison_is_not_decidable ();
}

/* { dg-final { scan-tree-dump-times "this_comparison_is_false" 0 "cfg" } } */
/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cfg" } } */
/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cfg" } } */
/* { dg-final { scan-tree-dump-times "if " 12 "cfg" } } */

/* { dg-final { cleanup-tree-dump "cfg" } } */