diff options
| -rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/nest.c | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4555450..89209b1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..60ced13 --- /dev/null +++ b/gcc/testsuite/gcc.dg/nest.c @@ -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; +} |
