| 1 |
/* This testcase could not assemble on ppc32, because the compiler assumed |
| 2 |
the huge ADDR_DIFF_VEC will be emitted into rodata section, yet because |
| 3 |
of some notes inserted between jump table's CODE_LABEL and the jump table |
| 4 |
it ended up in the .text section and thus shorten_branches couldn't |
| 5 |
figure out branch to lab is too far. */ |
| 6 |
/* { dg-do link { target fpic } } */ |
| 7 |
/* { dg-options "-g1 -fpic" } */ |
| 8 |
/* { dg-require-effective-target int32plus } */ |
| 9 |
|
| 10 |
#define A(n) \ |
| 11 |
case n##1: return n##1 * 131 + 63; \ |
| 12 |
case n##3: return n##3 * 1231 + 182; \ |
| 13 |
case n##5: return n##5 * 351 + 1; \ |
| 14 |
case n##7: return n##7 * 312 + 61; \ |
| 15 |
case n##9: return n##9 * 17 - 1; |
| 16 |
#define B(n) \ |
| 17 |
A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) \ |
| 18 |
A(n##5) A(n##6) A(n##7) A(n##8) A(n##9) |
| 19 |
#define C(n) \ |
| 20 |
B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) \ |
| 21 |
B(n##5) B(n##6) B(n##7) B(n##8) B(n##9) |
| 22 |
#define D(n) \ |
| 23 |
C(n##0) C(n##1) B(n##20) B(n##21) B(n##22) |
| 24 |
|
| 25 |
int |
| 26 |
foo (int x) |
| 27 |
{ |
| 28 |
{ |
| 29 |
lab:; |
| 30 |
int a = x; |
| 31 |
while (a < 60000) |
| 32 |
{ |
| 33 |
int b = a; |
| 34 |
{ |
| 35 |
int c = b; |
| 36 |
switch (c) |
| 37 |
{ |
| 38 |
D(1) |
| 39 |
default: break; |
| 40 |
} |
| 41 |
} |
| 42 |
a += 10000; |
| 43 |
if (a == 4168) |
| 44 |
goto lab; |
| 45 |
} |
| 46 |
} |
| 47 |
return x; |
| 48 |
} |
| 49 |
|
| 50 |
int |
| 51 |
main (void) |
| 52 |
{ |
| 53 |
foo (71); |
| 54 |
return 0; |
| 55 |
} |