]>
Commit | Line | Data |
---|---|---|
85272855 AM |
1 | /* PR 5967, PR 7114 */ |
2 | /* { dg-do run } */ | |
0d856ba2 | 3 | /* { dg-require-profiling "-pg" } */ |
85272855 | 4 | /* { dg-options "-O2 -pg" } */ |
f48758e4 | 5 | /* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */ |
b8ee7f02 | 6 | /* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */ |
85272855 | 7 | |
ee712eab JM |
8 | extern void abort (void); |
9 | ||
85272855 AM |
10 | long foo (long x) |
11 | { | |
12 | long i, sum = 0; | |
13 | long bar (long z) { return z * 2; } | |
14 | ||
15 | for (i = 0; i < x; i++) | |
16 | sum += bar (i); | |
17 | ||
18 | return sum; | |
19 | } | |
20 | ||
21 | int main (void) | |
22 | { | |
23 | if (foo(10) != 90) | |
24 | abort (); | |
25 | return 0; | |
26 | } | |
e3c58a3a UB |
27 | |
28 | /* { dg-final { cleanup-profile-file } } */ |