aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr103281-1.c
blob: 09964d0b46b046e82d30c43b9cd1fee892f866dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* PR tree-optmization/103281 */

void foo(void);

static unsigned b;

int main() {
  for (; b < 3; b++) {
    char c = b;
    char a = c ? c : c << 1;
    if (!(a < 1 ^ b))
      foo();
  }
}

/* the call to foo should be optimized away. */
/* { dg-final { scan-tree-dump-not "foo " "optimized" } } */