aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c
blob: 08530bd7d244acb90bb666f7adea3cca3c1ea83f (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
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-*"} } } */

/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */


int test (int a, int b, int c)
{
  if ( a == 10 || a == 12 || a == 26)
    return b;
  else
    return c;
}

int main ()
{
  if (test (10, 20, 30) != 20)
    __builtin_abort ();
  if (test (12, 20, 30) != 20)
    __builtin_abort ();
  if (test (26, 20, 30) != 20)
    __builtin_abort ();
  if (test (30, 20, 30) != 30)
    __builtin_abort ();
  return 0;
}

/* { dg-final { scan-tree-dump-times "Optimizing range tests .* 26" 1 "reassoc1"} }*/
/* { dg-final { cleanup-tree-dump "reassoc1" } } */