Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Test program for <next-at-end> and |
2 | * <leaves-core-file-on-quit> bugs. | |
3 | */ | |
4 | #include <stdio.h> | |
085dd6e6 | 5 | #include <stdlib.h> |
c906108c | 6 | |
dedad4e3 PA |
7 | #include "../lib/unbuffer_output.c" |
8 | ||
085dd6e6 | 9 | int callee (int x) |
c906108c | 10 | { |
04e5059b | 11 | int y = x * x; /* -break1- */ |
c906108c SS |
12 | return (y - 2); |
13 | } | |
14 | ||
085dd6e6 | 15 | int main() |
c906108c SS |
16 | { |
17 | ||
18 | int *p; | |
19 | int i; | |
20 | ||
dedad4e3 PA |
21 | gdb_unbuffer_output (); |
22 | ||
c906108c | 23 | p = (int *) malloc( 4 ); |
808a31f5 | 24 | |
c906108c SS |
25 | for (i = 1; i < 10; i++) |
26 | { | |
27 | printf( "%d ", callee( i )); | |
808a31f5 | 28 | fflush (stdout); |
c906108c | 29 | } |
04e5059b | 30 | printf( " Goodbye!\n" ); fflush (stdout); /* -break2- */ |
085dd6e6 | 31 | return 0; |
c906108c | 32 | } |