Commit | Line | Data |
---|---|---|
4749e309 MS |
1 | /* Copyright (C) 2001 Free Software Foundation, Inc. |
2 | ||
3 | This program is free software; you can redistribute it and/or modify | |
4 | it under the terms of the GNU General Public License as published by | |
5 | the Free Software Foundation; either version 2 of the License, or | |
6 | (at your option) any later version. | |
7 | ||
8 | This program is distributed in the hope that it will be useful, | |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | GNU General Public License for more details. | |
12 | ||
13 | You should have received a copy of the GNU General Public License | |
14 | along with this program; if not, write to the Free Software | |
15 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
16 | ||
17 | Please email any bugs, comments, and/or additions to this file to: | |
18 | bug-gdb@prep.ai.mit.edu */ | |
19 | ||
20 | ||
21 | /* | |
22 | * Initial set of typed variables borrowed from ptype.c | |
23 | */ | |
24 | ||
25 | #if !defined (__STDC__) && !defined (_AIX) | |
26 | #define signed /**/ | |
27 | #endif | |
28 | ||
29 | char v_char; | |
30 | signed char v_signed_char; | |
31 | unsigned char v_unsigned_char; | |
32 | ||
33 | short v_short; | |
34 | signed short v_signed_short; | |
35 | unsigned short v_unsigned_short; | |
36 | ||
37 | int v_int; | |
38 | signed int v_signed_int; | |
39 | unsigned int v_unsigned_int; | |
40 | ||
41 | long v_long; | |
42 | signed long v_signed_long; | |
43 | unsigned long v_unsigned_long; | |
44 | ||
45 | long long v_long_long; | |
46 | signed long long v_signed_long_long; | |
47 | unsigned long long v_unsigned_long_long; | |
48 | ||
49 | float v_float; | |
50 | double v_double; | |
51 | ||
52 | /* | |
53 | * Now some derived types, which are arrays, functions-returning, | |
54 | * pointers, structures, unions, and enumerations. | |
55 | */ | |
56 | ||
57 | /**** arrays *******/ | |
58 | ||
59 | char v_char_array[2]; | |
60 | signed char v_signed_char_array[2]; | |
61 | unsigned char v_unsigned_char_array[2]; | |
62 | ||
63 | short v_short_array[2]; | |
64 | signed short v_signed_short_array[2]; | |
65 | unsigned short v_unsigned_short_array[2]; | |
66 | ||
67 | int v_int_array[2]; | |
68 | signed int v_signed_int_array[2]; | |
69 | unsigned int v_unsigned_int_array[2]; | |
70 | ||
71 | long v_long_array[2]; | |
72 | signed long v_signed_long_array[2]; | |
73 | unsigned long v_unsigned_long_array[2]; | |
74 | ||
75 | float v_float_array[2]; | |
76 | double v_double_array[2]; | |
77 | ||
78 | /* PR 3742 */ | |
79 | typedef char t_char_array[]; | |
80 | ||
81 | /**** pointers *******/ | |
82 | ||
83 | char *v_char_pointer; | |
84 | signed char *v_signed_char_pointer; | |
85 | unsigned char *v_unsigned_char_pointer; | |
86 | ||
87 | short *v_short_pointer; | |
88 | signed short *v_signed_short_pointer; | |
89 | unsigned short *v_unsigned_short_pointer; | |
90 | ||
91 | int *v_int_pointer; | |
92 | signed int *v_signed_int_pointer; | |
93 | unsigned int *v_unsigned_int_pointer; | |
94 | ||
95 | long *v_long_pointer; | |
96 | signed long *v_signed_long_pointer; | |
97 | unsigned long *v_unsigned_long_pointer; | |
98 | ||
99 | float *v_float_pointer; | |
100 | double *v_double_pointer; | |
101 | ||
102 | char **v_char_pointer_pointer; | |
103 | signed char **v_signed_char_pointer_pointer; | |
104 | unsigned char **v_unsigned_char_pointer_pointer; | |
105 | ||
106 | short **v_short_pointer_pointer; | |
107 | signed short **v_signed_short_pointer_pointer; | |
108 | unsigned short **v_unsigned_short_pointer_pointer; | |
109 | ||
110 | int **v_int_pointer_pointer; | |
111 | signed int **v_signed_int_pointer_pointer; | |
112 | unsigned int **v_unsigned_int_pointer_pointer; | |
113 | ||
114 | long **v_long_pointer_pointer; | |
115 | signed long **v_signed_long_pointer_pointer; | |
116 | unsigned long **v_unsigned_long_pointer_pointer; | |
117 | ||
118 | float **v_float_pointer_pointer; | |
119 | double **v_double_pointer_pointer; | |
120 | ||
121 | /**** pointers to arrays, arrays of pointers *******/ | |
122 | ||
123 | char *v_char_array_pointer[2]; | |
124 | signed char *v_signed_char_array_pointer[2]; | |
125 | unsigned char *v_unsigned_char_array_pointer[2]; | |
126 | ||
127 | short *v_short_array_pointer[2]; | |
128 | signed short *v_signed_short_array_pointer[2]; | |
129 | unsigned short *v_unsigned_short_array_pointer[2]; | |
130 | ||
131 | int *v_int_array_pointer[2]; | |
132 | signed int *v_signed_int_array_pointer[2]; | |
133 | unsigned int *v_unsigned_int_array_pointer[2]; | |
134 | ||
135 | long *v_long_array_pointer[2]; | |
136 | signed long *v_signed_long_array_pointer[2]; | |
137 | unsigned long *v_unsigned_long_array_pointer[2]; | |
138 | ||
139 | float *v_float_array_pointer[2]; | |
140 | double *v_double_array_pointer[2]; | |
141 | ||
142 | char (*v_char_pointer_array)[2]; | |
143 | signed char (*v_signed_char_pointer_array)[2]; | |
144 | unsigned char (*v_unsigned_char_pointer_array)[2]; | |
145 | ||
146 | short (*v_short_pointer_array)[2]; | |
147 | signed short (*v_signed_short_pointer_array)[2]; | |
148 | unsigned short (*v_unsigned_short_pointer_array)[2]; | |
149 | ||
150 | int (*v_int_pointer_array)[2]; | |
151 | signed int (*v_signed_int_pointer_array)[2]; | |
152 | unsigned int (*v_unsigned_int_pointer_array)[2]; | |
153 | ||
154 | long (*v_long_pointer_array)[2]; | |
155 | signed long (*v_signed_long_pointer_array)[2]; | |
156 | unsigned long (*v_unsigned_long_pointer_array)[2]; | |
157 | ||
158 | float (*v_float_pointer_array)[2]; | |
159 | double (*v_double_pointer_array)[2]; | |
160 | ||
161 | ||
162 | /**** structs *******/ | |
163 | ||
164 | struct t_struct { | |
165 | char v_char_member; | |
166 | short v_short_member; | |
167 | int v_int_member; | |
168 | long v_long_member; | |
169 | float v_float_member; | |
170 | double v_double_member; | |
171 | } v_struct1; | |
172 | ||
173 | struct t_struct *v_t_struct_p; | |
174 | ||
175 | struct { | |
176 | char v_char_member; | |
177 | short v_short_member; | |
178 | int v_int_member; | |
179 | long v_long_member; | |
180 | float v_float_member; | |
181 | double v_double_member; | |
182 | } v_struct2; | |
183 | ||
184 | /* typedef'd struct without a tag. */ | |
185 | typedef struct { | |
186 | double v_double_member; | |
187 | int v_int_member; | |
188 | } t_struct3; | |
189 | /* GCC seems to want a variable of this type, or else it won't put out | |
190 | a symbol. */ | |
191 | t_struct3 v_struct3; | |
192 | ||
193 | /**** unions *******/ | |
194 | ||
195 | union t_union { | |
196 | char v_char_member; | |
197 | short v_short_member; | |
198 | int v_int_member; | |
199 | long v_long_member; | |
200 | float v_float_member; | |
201 | double v_double_member; | |
202 | } v_union; | |
203 | ||
204 | union { | |
205 | char v_char_member; | |
206 | short v_short_member; | |
207 | int v_int_member; | |
208 | long v_long_member; | |
209 | float v_float_member; | |
210 | double v_double_member; | |
211 | } v_union2; | |
212 | ||
213 | /* typedef'd union without a tag. */ | |
214 | typedef union { | |
215 | double v_double_member; | |
216 | int v_int_member; | |
217 | } t_union3; | |
218 | /* GCC seems to want a variable of this type, or else it won't put out | |
219 | a symbol. */ | |
220 | t_union3 v_union3; | |
221 | ||
222 | /**** Enumerations *******/ | |
223 | ||
224 | enum | |
225 | /* Work around the bug for compilers which don't put out the right stabs. */ | |
226 | #if __GNUC__ < 2 && !defined (_AIX) | |
227 | primary1_tag | |
228 | #endif | |
229 | {red1, green1, blue1} primary1; | |
230 | ||
231 | enum {red, green, blue} primary; | |
232 | enum colors {yellow, purple, pink} nonprimary; | |
233 | ||
234 | enum {chevy, ford} clunker; | |
235 | enum cars {bmw, porsche} sportscar; | |
236 | ||
237 | #undef FALSE | |
238 | #undef TRUE | |
239 | typedef enum {FALSE, TRUE} boolean; | |
240 | boolean v_boolean; | |
241 | /*note: aCC has bool type predefined with 'false' and 'true'*/ | |
242 | typedef enum bvals {my_false, my_true} boolean2; | |
243 | boolean2 v_boolean2; | |
244 | ||
245 | enum misordered {two = 2, one = 1, zero = 0, three = 3}; | |
246 | ||
247 | /* Seems like we need a variable of this type to get the type to be put | |
248 | in the executable, at least for AIX xlc. */ | |
249 | enum misordered v_misordered = three; | |
250 | ||
251 | /**** Function pointers *******/ | |
252 | ||
253 | char (*v_char_func) (int, int*); | |
254 | signed char (*v_signed_char_func) (int, int*); | |
255 | unsigned char (*v_unsigned_char_func) (int, int*); | |
256 | ||
257 | short (*v_short_func) (int, int*); | |
258 | signed short (*v_signed_short_func) (int, int*); | |
259 | unsigned short (*v_unsigned_short_func) (int, int*); | |
260 | ||
261 | int (*v_int_func) (int, int*); | |
262 | signed int (*v_signed_int_func) (int, int*); | |
263 | unsigned int (*v_unsigned_int_func) (int, int*); | |
264 | ||
265 | long (*v_long_func) (int, int*); | |
266 | signed long (*v_signed_long_func) (int, int*); | |
267 | unsigned long (*v_unsigned_long_func) (int, int*); | |
268 | ||
269 | long long (*v_long_long_func) (int, int*); | |
270 | signed long long (*v_signed_long_long_func) (int, int*); | |
271 | unsigned long long (*v_unsigned_long_long_func) (int, int*); | |
272 | ||
273 | float (*v_float_func) (int, int*); | |
274 | double (*v_double_func) (int, int*); | |
275 | ||
276 | ||
277 | ||
278 | int main () | |
279 | { | |
280 | } |