summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/debug-6.c38
2 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a756c74ae77..f47c334b05e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2001-12-30 Richard Henderson <rth@redhat.com>
+
+ * gcc.dg/debug-6.c: New.
+
2001-12-30 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/compile/20011229-2.c: New test.
diff --git a/gcc/testsuite/gcc.dg/debug-6.c b/gcc/testsuite/gcc.dg/debug-6.c
new file mode 100644
index 00000000000..1ed8679c9d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug-6.c
@@ -0,0 +1,38 @@
+/* Verify that bb-reorder re-inserts nested scopes properly. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -dA" } */
+/* { dg-final { scan-assembler "xyzzy" } } */
+
+extern void abort (void);
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar2 (struct A *x)
+{
+ int a = x->c - x->b;
+ x->c += 26;
+ return a;
+}
+
+void fnptr (int *);
+
+void
+foo (void)
+{
+ struct A e;
+
+ if (bar2 (&e) < 0)
+ abort ();
+ {
+ int xyzzy;
+ fnptr (&xyzzy);
+ }
+ {
+ struct A *f;
+
+ f = &e;
+ if (f->c - f->a > f->d - f->a)
+ f->c = f->d;
+ }
+}