diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/const-elim-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/const-elim-2.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/const-elim-2.c b/gcc/testsuite/gcc.dg/const-elim-2.c new file mode 100644 index 0000000..ce55ba1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/const-elim-2.c @@ -0,0 +1,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 } } */ + +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"; } |