| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-require-profiling "-p" } */ |
| 3 |
/* { dg-options "-O2 -p" } */ |
| 4 |
/* { dg-options "-O2 -p -static" { target hppa*-*-hpux* } } */ |
| 5 |
/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */ |
| 6 |
/* { dg-message "" "consider using `-pg' instead of `-p' with gprof(1)" { target *-*-freebsd* } 0 } */ |
| 7 |
|
| 8 |
extern void abort (void); |
| 9 |
extern void exit (int); |
| 10 |
|
| 11 |
int foo (void) |
| 12 |
{ |
| 13 |
int bar (int x) |
| 14 |
{ |
| 15 |
return x + 3; |
| 16 |
} |
| 17 |
return bar (1) + bar (2); |
| 18 |
} |
| 19 |
|
| 20 |
int main (void) |
| 21 |
{ |
| 22 |
if (foo () != 9) |
| 23 |
abort (); |
| 24 |
exit (0); |
| 25 |
} |
| 26 |
|
| 27 |
/* { dg-final { cleanup-profile-file } } */ |