1 /* PR tree-optimization/36881 */
2 /* { dg-do compile { target fpic } } */
3 /* { dg-options "-O2 -fpic -fdump-tree-switchconv-all" } */
4
foo(int i)5 const char *foo (int i)
6 {
7 const char *p;
8 switch (i)
9 {
10 case 0:
11 case 6: p = ""; break;
12 case 1:
13 case 7: p = "abc"; break;
14 case 2:
15 case 8: p = "def"; break;
16 case 9: p = "ghi"; break;
17 case 5: p = "jkl"; break;
18 case 3: p = "mno"; break;
19 default: p = "prq"; break;
20 }
21 return p;
22 }
23
24 /* { dg-final { scan-assembler-not "CSWTCH" } } */
25 /* { dg-final { scan-tree-dump "need runtime relocations" "switchconv" } } */
26 /* { dg-final { cleanup-tree-dump "switchconv" } } */
27