comparison gcc/testsuite/gcc.dg/fdata-sections-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 1830386684a0
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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* } } */
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} } } */