aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/pr45830.c
blob: 85d5a3c5ab0c9ed3c1ec61ccc796379c64c02179 (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
30
31
/* PR target/45830 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-switchconv-all -mtune=generic" } */

int
foo (int *a)
{
  switch (*a)
    {
    case 0:
    case 3:
    case 1:
    case 2:
    case 4:
    case 23:
    case 26:
    case 19:
    case 5:
    case 21:
    case 20:
    case 22:
    case 27:
      return 1;
    default:
      return 0;
    }
}

/* { dg-final { scan-tree-dump "expanding as bit test is preferable" "switchconv" } } */
/* { dg-final { scan-assembler-not "CSWTCH" } } */
/* { dg-final { cleanup-tree-dump "switchconv" } } */