summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/const-elim-2.c
blob: bc465cabaca41bb5ef369b7321b337f6ca60a71b (plain)
1
2
3
4
5
6
7
8
9
10
/* The string constant in this test case should be emitted exactly once.  */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-times "hi there" 1 { xfail nvptx-*-* pdp11-*-* } } } */

static inline int returns_23() { return 23; }

const char *test1(void) { if (returns_23()) return 0; return "hi there"; }
const char *test2(void) { return "hi there"; }
const char *test3(void) { return "hi there"; }