aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36881.c
blob: 96922e3a62f8d5a440e080653da287ada8740d38 (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
/* PR tree-optimization/36881 */
/* { dg-do compile { target fpic } } */
/* { dg-options "-O2 -fpic -fdump-tree-switchconv-all" } */

const char *foo (int i)
{
  const char *p;
  switch (i)
    {
    case 0:
    case 6: p = ""; break;
    case 1:
    case 7: p = "abc"; break;
    case 2:
    case 8: p = "def"; break;
    case 9: p = "ghi"; break;
    case 5: p = "jkl"; break;
    case 3: p = "mno"; break;
    default: p = "prq"; break;
    }
  return p;
}

/* { dg-final { scan-assembler-not "CSWTCH" } } */
/* { dg-final { scan-tree-dump "need runtime relocations" "switchconv" } } */
/* { dg-final { cleanup-tree-dump "switchconv" } } */