[PATCH 7/57][Arm][GAS] Add support for MVE instructions: vstr/vldr
[binutils-gdb.git] / gdb / testsuite / gdb.base / nodebug.c
blobc7bc93991b846c1854dbef3f0a2a64af47722c79
1 #include <stdlib.h>
2 #include <stdint.h>
4 /* Test that things still (sort of) work when compiled without -g. */
6 int dataglobal = 3; /* Should go in global data */
7 static int datalocal = 4; /* Should go in local data */
8 int bssglobal; /* Should go in global bss */
9 static int bsslocal; /* Should go in local bss */
11 /* Non-int-sized global data variables. */
12 uint8_t dataglobal8 = 0xff;
13 uint32_t dataglobal32_1 = 0x7fffffff;
14 uint32_t dataglobal32_2 = 0x000000ff;
15 uint64_t dataglobal64_1 = 0x7fffffffffffffff;
16 uint64_t dataglobal64_2 = 0x00000000000000ff;
18 int
19 inner (int x)
21 return x + dataglobal + datalocal + bssglobal + bsslocal;
24 static short
25 middle (int x)
27 return 2 * inner (x);
30 short
31 top (int x)
33 return 2 * middle (x);
36 int
37 main (int argc, char **argv)
39 return top (argc);
42 int *x;
44 int array_index (char *arr, int i)
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;
56 float
57 multf (float v1, float v2)
59 return v1 * v2;
62 float
63 multf_noproto (v1, v2)
64 float v1, v2;
66 return v1 * v2;
69 double
70 mult (double v1, double v2)
72 return v1 * v2;
75 double
76 mult_noproto (v1, v2)
77 double v1, v2;
79 return v1 * v2;
82 uint8_t
83 add8 (uint8_t v1, uint8_t v2)
85 return v1 + v2;
88 uint8_t
89 add8_noproto (v1, v2)
90 uint8_t v1, v2;
92 return v1 + v2;