blob: 742dd9ddb4b50fe8c64dcb03ba4c4b8f818a8438 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/* 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;
default: p = "ghi"; break;
}
return p;
}
/* { dg-final { scan-assembler-not "CSWTCH" } } */
/* { dg-final { scan-tree-dump "need runtime relocations" "switchconv" } } */
/* { dg-final { cleanup-tree-dump "switchconv" } } */
|