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

void foo (int nest, int print_nest)
{
  _Bool t0 = nest != 0;
  _Bool t1 = nest == print_nest;
  _Bool t2 = t0 & t1;
  if (t2)
    __builtin_puts ("x");
  nest++;
  if (nest > 2)
    __builtin_abort ();
  if (print_nest == nest)
    __builtin_puts ("y");
}

/* We should be able to thread (t2) to !(print_nest == nest) using the
   nest == print_nest relation implied by the entry block.  */
/* { dg-final { scan-tree-dump "Jumps threaded: 1" "threadfull1" } } */