OSDN Git Service

* gcc.dg/20021014-1.c: Bypass errors on solaris2 and irix6.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / nest.c
1 /* PR 5967, PR 7114 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -pg" } */
4 /* { dg-error "profiler" "No profiler support" { target mmix-*-* } 0 } */
5 /* Support for -pg on irix relies on gcrt1.o which doesn't exist yet.
6    See: http://gcc.gnu.org/ml/gcc/2002-10/msg00169.html */
7 /* { dg-error "gcrt1.o" "Profiler support missing" { target mips*-*-irix* } 0 } */
8
9 long foo (long x)
10 {
11   long i, sum = 0;
12   long bar (long z) { return z * 2; }
13
14   for (i = 0; i < x; i++)
15     sum += bar (i);
16
17   return sum;
18 }
19
20 int main (void)
21 {
22   if (foo(10) != 90)
23     abort ();
24   return 0;
25 }