xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.base/ending-run.c (revision d909946ca08dceb44d7d0f22ec9488679695d976)
1 /* Test program for <next-at-end> and
2  * <leaves-core-file-on-quit> bugs.
3  */
4 #include <stdio.h>
5 #include <stdlib.h>
6 
7 int callee (int x)
8 {
9     int y = x * x;		/* -break1- */
10     return (y - 2);
11 }
12 
13 int main()
14 {
15 
16     int *p;
17     int i;
18 
19     p = (int *) malloc( 4 );
20 
21     for (i = 1; i < 10; i++)
22         {
23             printf( "%d ", callee( i ));
24             fflush (stdout);
25         }
26     printf( " Goodbye!\n" ); fflush (stdout); /* -break2- */
27     return 0;
28 }
29