| 1 |
/* PR middle-end/192 */ |
| 2 |
/* PR middle-end/54303 */ |
| 3 |
|
| 4 |
/* This checks that string constants are put in per-function rodata |
| 5 |
sections, so that they can be garbage collected. */ |
| 6 |
|
| 7 |
/* { dg-do compile { target *-*-linux* *-*-uclinux* } } */ |
| 8 |
/* { dg-options "-O -ffunction-sections -fdata-sections" } */ |
| 9 |
|
| 10 |
const char *f1(void) { return "falderalde"; } |
| 11 |
const char *f2(void) { return "a"; } |
| 12 |
const char *f3(void) { return "falderalde"; } |
| 13 |
const char *f4(void) { return "eralde"; } |
| 14 |
|
| 15 |
/* { dg-final { scan-assembler {\.rodata\.f1\.str} } } */ |
| 16 |
/* { dg-final { scan-assembler {\.rodata\.f2\.str} } } */ |
| 17 |
/* { dg-final { scan-assembler-not {\.rodata\.f3\.str} } } */ |
| 18 |
/* { dg-final { scan-assembler {\.rodata\.f4\.str} } } */ |