summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c')
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
index feafb33e82..baa2f66e8a 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
@@ -1,7 +1,7 @@
/* Verify that only one DW_AT_const_value is emitted for baz,
not for baz abstract DIE and again inside of
DW_TAG_inlined_subroutine. */
-/* { dg-options "-O2 -g -dA" } */
+/* { dg-options "-O2 -gdwarf -dA -fmerge-all-constants" } */
/* { dg-do compile } */
/* { dg-final { scan-assembler-times " DW_AT_const_value" 1 } } */
@@ -11,6 +11,9 @@ static inline long
foo (void)
{
const struct A baz = { .i = 2, .j = 21 };
+ /* We must make sure that baz isn't optimized away before inlining,
+ otherwise its initializer is also lost. */
+ const struct A *p = &baz;
asm volatile ("" : : : "memory");
return baz.i * baz.j;
}