aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c
new file mode 100644
index 000000000..62e824a54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c
@@ -0,0 +1,26 @@
+/* This testcase failed, because scope containing baz was not emitted
+ (doesn't contain any instructions) and DWARF-2 couldn't find baz origin. */
+/* { dg-do compile } */
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar (struct A *x)
+{
+ return x->c - x->b;
+}
+
+void
+foo (void)
+{
+ struct A e;
+
+ {
+ int baz (void)
+ {
+ return bar (&e);
+ }
+ }
+ if (e.c - e.a > e.d - e.a)
+ e.c = e.d;
+}