summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp54.c
blob: 6e8da77581b9aab2d973becd9880b51c612fb34b (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
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp1" } */

extern void link_error (void);
void foo (void)
{
  int j = 256;
  do
    {
      if (j < 0 || j > 256)
	link_error ();
      j--;
    }
  while (j >= 0);
  if (j != -1)
    link_error ();
}
extern void link_error (void);
void bar (void)
{
  int j = 0;
  do
    {
      if (j < 0 || j > 256)
	link_error ();
      j++;
    }
  while (j <= 256);
  if (j != 257)
    link_error ();
}

/* { dg-final { scan-tree-dump-not "link_error" "vrp1" } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */