aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp60.c
blob: 059d76473e6d17f38160e1b266962ab3d19414d0 (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
/* { dg-do compile } */
/* { dg-options "-O2 -fno-tree-ccp -fno-tree-dominator-opts -fdump-tree-vrp1" } */

int foo (int x, int b)
{
  int cst;
  if (b)
    cst = -__INT_MAX__ - 1;
  else
    cst = -__INT_MAX__;
  x = x | cst;
  if (x >= 0)
    return 12345;
  return x;
}

int bar (int x, int b)
{
  int cst;
  if (b)
    cst = __INT_MAX__;
  else
    cst = __INT_MAX__ - 1;
  x = x & cst;
  if (x < 0)
    return 12345;
  return x;
}

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