Clean up "Reading symbols" output
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / nodebug.c
CommitLineData
085dd6e6 1#include <stdlib.h>
7022349d
PA
2#include <stdint.h>
3
c906108c
SS
4/* Test that things still (sort of) work when compiled without -g. */
5
6int dataglobal = 3; /* Should go in global data */
7static int datalocal = 4; /* Should go in local data */
8int bssglobal; /* Should go in global bss */
9static int bsslocal; /* Should go in local bss */
10
46a4882b
PA
11/* Non-int-sized global data variables. */
12uint8_t dataglobal8 = 0xff;
13uint32_t dataglobal32_1 = 0x7fffffff;
14uint32_t dataglobal32_2 = 0x000000ff;
15uint64_t dataglobal64_1 = 0x7fffffffffffffff;
16uint64_t dataglobal64_2 = 0x00000000000000ff;
17
085dd6e6
JM
18int
19inner (int x)
c906108c
SS
20{
21 return x + dataglobal + datalocal + bssglobal + bsslocal;
22}
23
085dd6e6
JM
24static short
25middle (int x)
c906108c
SS
26{
27 return 2 * inner (x);
28}
29
085dd6e6
JM
30short
31top (int x)
c906108c
SS
32{
33 return 2 * middle (x);
34}
35
085dd6e6
JM
36int
37main (int argc, char **argv)
c906108c 38{
c906108c
SS
39 return top (argc);
40}
41
c906108c
SS
42int *x;
43
085dd6e6 44int array_index (char *arr, int i)
c906108c
SS
45{
46 /* The basic concept is just "return arr[i];". But call malloc so that gdb
47 will be able to call functions. */
48 char retval;
49 x = (int *) malloc (sizeof (int));
50 *x = i;
51 retval = arr[*x];
52 free (x);
53 return retval;
54}
7022349d
PA
55
56float
57multf (float v1, float v2)
58{
59 return v1 * v2;
60}
61
62float
63multf_noproto (v1, v2)
64 float v1, v2;
65{
66 return v1 * v2;
67}
68
69double
70mult (double v1, double v2)
71{
72 return v1 * v2;
73}
74
75double
76mult_noproto (v1, v2)
77 double v1, v2;
78{
79 return v1 * v2;
80}
81
82uint8_t
83add8 (uint8_t v1, uint8_t v2)
84{
85 return v1 + v2;
86}
87
88uint8_t
89add8_noproto (v1, v2)
90 uint8_t v1, v2;
91{
92 return v1 + v2;
93}
This page took 1.904553 seconds and 4 git commands to generate.