summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp71.c
blob: 0308fc1c420833bf36f854806cacad142d6d9da7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp1" } */

int foo(int *p)
{
  int x = -10;
  if (p[0]) x++;
  if (p[1]) x++;
  if (p[2]) x++;
  if (p[3]) x++;
  x <<= 2;
  return (x > 0);
}

int bar(char c)
{
  int i = c << 1;
  return i > 1000;
}

/* { dg-final { scan-tree-dump-times "return 0;" 2 "vrp1" } } */