2 * Test file with lots of different types, for testing the
7 * First the basic C types.
10 #if !(defined (__STDC__) || defined (_AIX))
15 signed char v_signed_char
;
16 unsigned char v_unsigned_char
;
19 signed short v_signed_short
;
20 unsigned short v_unsigned_short
;
23 signed int v_signed_int
;
24 unsigned int v_unsigned_int
;
27 signed long v_signed_long
;
28 unsigned long v_unsigned_long
;
34 * Now some derived types, which are arrays, functions-returning,
35 * pointers, structures, unions, and enumerations.
41 signed char v_signed_char_array
[2];
42 unsigned char v_unsigned_char_array
[2];
44 short v_short_array
[2];
45 signed short v_signed_short_array
[2];
46 unsigned short v_unsigned_short_array
[2];
49 signed int v_signed_int_array
[2];
50 unsigned int v_unsigned_int_array
[2];
53 signed long v_signed_long_array
[2];
54 unsigned long v_unsigned_long_array
[2];
56 float v_float_array
[2];
57 double v_double_array
[2];
59 /**** pointers *******/
61 /* Make sure they still print as pointer to foo even there is a typedef
62 for that type. Test this not just for char *, which might be
63 a special case kludge in GDB (Unix system include files like to define
64 caddr_t), but for a variety of types. */
65 typedef char *char_addr
;
66 typedef unsigned short *ushort_addr
;
67 typedef signed long *slong_addr
;
70 signed char *v_signed_char_pointer
;
71 unsigned char *v_unsigned_char_pointer
;
73 short *v_short_pointer
;
74 signed short *v_signed_short_pointer
;
75 unsigned short *v_unsigned_short_pointer
;
78 signed int *v_signed_int_pointer
;
79 unsigned int *v_unsigned_int_pointer
;
82 signed long *v_signed_long_pointer
;
83 unsigned long *v_unsigned_long_pointer
;
85 float *v_float_pointer
;
86 double *v_double_pointer
;
88 /**** structs *******/
96 double v_double_member
;
101 short v_short_member
;
104 float v_float_member
;
105 double v_double_member
;
108 /**** unions *******/
112 short v_short_member
;
115 float v_float_member
;
116 double v_double_member
;
121 short v_short_member
;
124 float v_float_member
;
125 double v_double_member
;
128 /*** Functions returning type ********/
130 char v_char_func () { return(0); }
131 signed char v_signed_char_func () { return (0); }
132 unsigned char v_unsigned_char_func () { return (0); }
134 short v_short_func () { return (0); }
135 signed short v_signed_short_func () { return (0); }
136 unsigned short v_unsigned_short_func () { return (0); }
138 int v_int_func () { return (0); }
139 signed int v_signed_int_func () { return (0); }
140 unsigned int v_unsigned_int_func () { return (0); }
142 long v_long_func () { return (0); }
143 signed long v_signed_long_func () { return (0); }
144 unsigned long v_unsigned_long_func () { return (0); }
146 float v_float_func () { return (0.0); }
147 double v_double_func () { return (0.0); }
149 /**** Some misc more complicated things *******/
154 struct link
*(*linkfunc
) (struct link
*this, int flags
);
156 struct link
*(*linkfunc
) ();
158 struct t_struct stuff
[1][2][3];
164 struct link
*(*linkfunc
) (struct link
*this, int flags
);
166 struct link
*(*linkfunc
) ();
168 struct t_struct stuff
[1][2][3];
171 struct outer_struct
{
173 struct inner_struct
{
176 }inner_struct_instance
;
179 long inner_union_long
;
180 }inner_union_instance
;
184 /**** Enumerations *******/
186 enum colors
{red
, green
, blue
} color
;
187 enum cars
{chevy
, ford
, porsche
} clunker
;
197 /* Some linkers (e.g. on AIX) remove unreferenced variables,
198 so make sure to reference them. */
205 v_unsigned_short
= 5;
213 v_unsigned_long
= 11;
219 v_char_array
[0] = v_char
;
220 v_signed_char_array
[0] = v_signed_char
;
221 v_unsigned_char_array
[0] = v_unsigned_char
;
223 v_short_array
[0] = v_short
;
224 v_signed_short_array
[0] = v_signed_short
;
225 v_unsigned_short_array
[0] = v_unsigned_short
;
227 v_int_array
[0] = v_int
;
228 v_signed_int_array
[0] = v_signed_int
;
229 v_unsigned_int_array
[0] = v_unsigned_int
;
231 v_long_array
[0] = v_long
;
232 v_signed_long_array
[0] = v_signed_long
;
233 v_unsigned_long_array
[0] = v_unsigned_long
;
235 v_float_array
[0] = v_float
;
236 v_double_array
[0] = v_double
;
238 v_char_pointer
= &v_char
;
239 v_signed_char_pointer
= &v_signed_char
;
240 v_unsigned_char_pointer
= &v_unsigned_char
;
242 v_short_pointer
= &v_short
;
243 v_signed_short_pointer
= &v_signed_short
;
244 v_unsigned_short_pointer
= &v_unsigned_short
;
246 v_int_pointer
= &v_int
;
247 v_signed_int_pointer
= &v_signed_int
;
248 v_unsigned_int_pointer
= &v_unsigned_int
;
250 v_long_pointer
= &v_long
;
251 v_signed_long_pointer
= &v_signed_long
;
252 v_unsigned_long_pointer
= &v_unsigned_long
;
254 v_float_pointer
= &v_float
;
255 v_double_pointer
= &v_double
;
260 u_link
.next
= s_link
;
262 v_union2
.v_short_member
= v_union
.v_short_member
;
264 v_struct1
.v_char_member
= 0;
265 v_struct2
.v_char_member
= 0;
267 nested_su
.outer_int
= 0;
This page took 0.033996 seconds and 4 git commands to generate.