aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr45830.c
blob: dfe1b0d1a019b6e3d91b6c8469a071802e8fae81 (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
/* 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" } } */