2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / nest.c
blob872feade5810e6567c8f8f9d647df622783fdbf1
1 /* PR 5967, PR 7114 */
2 /* { dg-do run } */
3 /* { dg-require-profiling "" } */
4 /* { dg-options "-O2 -pg" } */
5 /* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */
6 /* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
7 /* Support for -pg on irix relies on gcrt1.o which doesn't exist yet.
8 See: http://gcc.gnu.org/ml/gcc/2002-10/msg00169.html */
9 /* { dg-error "gcrt1.o" "Profiler support missing" { target mips*-*-irix* } 0 } */
10 /* { dg-error "-pg not supported" "Profiler support missing" { target *-*-sco3.2v5* } 0 } */
12 long foo (long x)
14 long i, sum = 0;
15 long bar (long z) { return z * 2; }
17 for (i = 0; i < x; i++)
18 sum += bar (i);
20 return sum;
23 int main (void)
25 if (foo(10) != 90)
26 abort ();
27 return 0;