OSDN Git Service

* gcc.dg/nest.c: New.
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jul 2002 03:41:04 +0000 (03:41 +0000)
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jul 2002 03:41:04 +0000 (03:41 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55546 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/nest.c [new file with mode: 0644]

index 4555450..89209b1 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-18  Alan Modra  <amodra@bigpond.net.au>
+
+       * gcc.dg/nest.c: New.
+
 2002-07-17  Eric Botcazou  <ebotcazou@multimania.com>
 
        * gcc.c-torture/execute/loop-2e.x: Let the testcase
diff --git a/gcc/testsuite/gcc.dg/nest.c b/gcc/testsuite/gcc.dg/nest.c
new file mode 100644 (file)
index 0000000..60ced13
--- /dev/null
@@ -0,0 +1,21 @@
+/* PR 5967, PR 7114 */
+/* { dg-do run } */
+/* { dg-options "-O2 -pg" } */
+
+long foo (long x)
+{
+  long i, sum = 0;
+  long bar (long z) { return z * 2; }
+
+  for (i = 0; i < x; i++)
+    sum += bar (i);
+
+  return sum;
+}
+
+int main (void)
+{
+  if (foo(10) != 90)
+    abort ();
+  return 0;
+}