Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Test that things still (sort of) work when compiled without -g. */ |
2 | ||
3 | int dataglobal = 3; /* Should go in global data */ | |
4 | static int datalocal = 4; /* Should go in local data */ | |
5 | int bssglobal; /* Should go in global bss */ | |
6 | static int bsslocal; /* Should go in local bss */ | |
7 | ||
8 | int | |
9 | inner (x) | |
10 | int x; | |
11 | { | |
12 | return x + dataglobal + datalocal + bssglobal + bsslocal; | |
13 | } | |
14 | ||
15 | static short | |
16 | middle (x) | |
17 | int x; | |
18 | { | |
19 | return 2 * inner (x); | |
20 | } | |
21 | ||
22 | short | |
23 | top (x) | |
24 | int x; | |
25 | { | |
26 | return 2 * middle (x); | |
27 | } | |
28 | ||
29 | int | |
30 | main (argc, argv) | |
31 | int argc; | |
32 | char **argv; | |
33 | { | |
34 | #ifdef usestubs | |
35 | set_debug_traps(); | |
36 | breakpoint(); | |
37 | #endif | |
38 | return top (argc); | |
39 | } | |
40 | ||
41 | char *malloc (); | |
42 | ||
43 | int *x; | |
44 | ||
45 | int | |
46 | array_index (arr, i) | |
47 | char *arr; | |
48 | int i; | |
49 | { | |
50 | /* The basic concept is just "return arr[i];". But call malloc so that gdb | |
51 | will be able to call functions. */ | |
52 | char retval; | |
53 | x = (int *) malloc (sizeof (int)); | |
54 | *x = i; | |
55 | retval = arr[*x]; | |
56 | free (x); | |
57 | return retval; | |
58 | } |