svn merge -r102224:107263 svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-3_4-branch
[official-gcc.git] / gcc / testsuite / gcc.dg / nest.c
blob264dde26f05f81543d0f0eb108c04352f3ec696c
1 /* PR 5967, PR 7114 */
2 /* { dg-do run } */
3 /* { dg-require-profiling "-pg" } */
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 /* { dg-error "-pg not supported" "Profiler support missing" { target *-*-sco3.2v5* } 0 } */
9 long foo (long x)
11 long i, sum = 0;
12 long bar (long z) { return z * 2; }
14 for (i = 0; i < x; i++)
15 sum += bar (i);
17 return sum;
20 int main (void)
22 if (foo(10) != 90)
23 abort ();
24 return 0;