aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp64.c
blob: 2ab328f1d8b6cda623596644dabb0fbb88ff97c3 (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
/* PR tree-optimization/51721 */
/* { dg-do link } */
/* { dg-options "-O2" } */

extern void link_error (void);

#define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)

void
f1 (unsigned int s)
{
  if (s >> BITSM1 != 0)
    {
      if (s == 0 || s == 5 || s == __INT_MAX__)
	link_error ();
    }
  else
    {
      if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
	link_error ();
    }
}

void
f2 (int s)
{
  if (s >> BITSM1 == 0)
    {
      if (s == -1 || s == -5 || s == -__INT_MAX__ - 1)
	link_error ();
    }
  else
    {
      if (s == 0 || s == 5 || s == __INT_MAX__)
	link_error ();
    }
}

void
f3 (unsigned int s)
{
  if ((s & (1U << BITSM1)) != 0)
    {
      if (s == 0 || s == 5 || s == __INT_MAX__)
	link_error ();
    }
  else
    {
      if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
	link_error ();
    }
}

void
f4 (int s)
{
  if ((s & (1U << BITSM1)) == 0)
    {
      if (s == -1 || s == -5 || s == -__INT_MAX__ - 1)
	link_error ();
    }
  else
    {
      if (s == 0 || s == 5 || s == __INT_MAX__)
	link_error ();
    }
}

void
f5 (unsigned int s)
{
  if ((int) s < 0)
    {
      if (s == 0 || s == 5 || s == __INT_MAX__)
	link_error ();
    }
  else
    {
      if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
	link_error ();
    }
}

void
f6 (unsigned int s)
{
  if ((int) s < 4)
    {
      if (s == 4 || s == 6 || s == __INT_MAX__)
	link_error ();
    }
  else
    {
      if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U
	  || s == 3 || s == 0)
	link_error ();
    }
}

void
f7 (unsigned int s)
{
  if ((int) s <= -7)
    {
      if (s == -6U || s == -1U || s == 0 || s == 4 || s == 6 || s == __INT_MAX__)
	link_error ();
    }
  else
    {
      if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -9U
	  || s == -7U)
	link_error ();
    }
}

void
f8 (unsigned int s)
{
  if ((int) s >= 4)
    {
      if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U
	  || s == 3 || s == 0)
	link_error ();
    }
  else
    {
      if (s == 4 || s == 6 || s == __INT_MAX__)
	link_error ();
    }
}

void
f9 (unsigned int s)
{
  if ((int) s > -7)
    {
      if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -9U
	  || s == -7U)
	link_error ();
    }
  else
    {
      if (s == -6U || s == -1U || s == 0 || s == 4 || s == 6 || s == __INT_MAX__)
	link_error ();
    }
}

int
main ()
{
  return 0;
}