aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/loop-unswitch-15.c
blob: 87139bb333439208a870afc8c5bbbfbaacd4685b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-optimized" } */

void bar();
void baz();
void foo (int a, int b, int n)
{
  for (int i = 0; i < n; ++i)
    if (a < b)
      bar ();
    else
      baz ();
}

/* { dg-final { scan-tree-dump "unswitching loop . on .if. with condition:" "unswitch" } } */