1 int main (int argc
, char **argv
, char **envp
)
9 /* We put main() right up front so its line number doesn't keep changing. */
12 * Test file with lots of different types, for testing the
17 * First the basic C types.
20 #if !defined (__STDC__) && !defined (_AIX)
25 signed char v_signed_char
;
26 unsigned char v_unsigned_char
;
29 signed short v_signed_short
;
30 unsigned short v_unsigned_short
;
33 signed int v_signed_int
;
34 unsigned int v_unsigned_int
;
37 signed long v_signed_long
;
38 unsigned long v_unsigned_long
;
43 * Now some derived types, which are arrays, functions-returning,
44 * pointers, structures, unions, and enumerations.
50 signed char v_signed_char_array
[2];
51 unsigned char v_unsigned_char_array
[2];
53 short v_short_array
[2];
54 signed short v_signed_short_array
[2];
55 unsigned short v_unsigned_short_array
[2];
58 signed int v_signed_int_array
[2];
59 unsigned int v_unsigned_int_array
[2];
62 signed long v_signed_long_array
[2];
63 unsigned long v_unsigned_long_array
[2];
65 float v_float_array
[2];
66 double v_double_array
[2];
68 /**** initialized array *******/
70 int v_int_array_init
[2] = { 10, 20 };
72 /**** pointers *******/
75 signed char *v_signed_char_pointer
;
76 unsigned char *v_unsigned_char_pointer
;
78 short *v_short_pointer
;
79 signed short *v_signed_short_pointer
;
80 unsigned short *v_unsigned_short_pointer
;
83 signed int *v_signed_int_pointer
;
84 unsigned int *v_unsigned_int_pointer
;
87 signed long *v_signed_long_pointer
;
88 unsigned long *v_unsigned_long_pointer
;
90 float *v_float_pointer
;
91 double *v_double_pointer
;
93 /**** structs *******/
100 float v_float_member
;
101 double v_double_member
;
106 short v_short_member
;
109 float v_float_member
;
110 double v_double_member
;
113 /**** unions *******/
117 short v_short_member
;
120 float v_float_member
;
121 double v_double_member
;
126 short v_short_member
;
129 float v_float_member
;
130 double v_double_member
;
133 /*** Functions returning type ********/
135 char v_char_func () { return(0); }
136 signed char v_signed_char_func () { return (0); }
137 unsigned char v_unsigned_char_func () { return (0); }
139 short v_short_func () { return (0); }
140 signed short v_signed_short_func () { return (0); }
141 unsigned short v_unsigned_short_func () { return (0); }
143 int v_int_func () { return (0); }
144 signed int v_signed_int_func () { return (0); }
145 unsigned int v_unsigned_int_func () { return (0); }
147 long v_long_func () { return (0); }
148 signed long v_signed_long_func () { return (0); }
149 unsigned long v_unsigned_long_func () { return (0); }
151 float v_float_func () { return (0.0); }
152 double v_double_func () { return (0.0); }
154 /**** Some misc more complicated things *******/
159 struct link
*(*linkfunc
) (struct link
*self
, int flags
);
161 struct link
*(*linkfunc
) ();
163 struct t_struct stuff
[1][2][3];
169 struct link
*(*linkfunc
) (struct link
*self
, int flags
);
171 struct link
*(*linkfunc
) ();
173 struct t_struct stuff
[1][2][3];
176 /**** Enumerations *******/
178 enum colors
{red
, green
, blue
} color
;
179 enum cars
{chevy
, ford
, porsche
} clunker
;
181 struct t_struct
*null_t_struct
;
185 /* Some linkers (e.g. on AIX) remove unreferenced variables,
186 so make sure to reference them. */
193 v_unsigned_short
= 5;
201 v_unsigned_long
= 11;
205 v_char_array
[0] = v_char
;
206 v_signed_char_array
[0] = v_signed_char
;
207 v_unsigned_char_array
[0] = v_unsigned_char
;
209 v_short_array
[0] = v_short
;
210 v_signed_short_array
[0] = v_signed_short
;
211 v_unsigned_short_array
[0] = v_unsigned_short
;
213 v_int_array
[0] = v_int
;
214 v_signed_int_array
[0] = v_signed_int
;
215 v_unsigned_int_array
[0] = v_unsigned_int
;
217 v_long_array
[0] = v_long
;
218 v_signed_long_array
[0] = v_signed_long
;
219 v_unsigned_long_array
[0] = v_unsigned_long
;
221 v_float_array
[0] = v_float
;
222 v_double_array
[0] = v_double
;
223 v_char_pointer
= &v_char
;
224 v_signed_char_pointer
= &v_signed_char
;
225 v_unsigned_char_pointer
= &v_unsigned_char
;
227 v_short_pointer
= &v_short
;
228 v_signed_short_pointer
= &v_signed_short
;
229 v_unsigned_short_pointer
= &v_unsigned_short
;
231 v_int_pointer
= &v_int
;
232 v_signed_int_pointer
= &v_signed_int
;
233 v_unsigned_int_pointer
= &v_unsigned_int
;
235 v_long_pointer
= &v_long
;
236 v_signed_long_pointer
= &v_signed_long
;
237 v_unsigned_long_pointer
= &v_unsigned_long
;
239 v_float_pointer
= &v_float
;
240 v_double_pointer
= &v_double
;
245 u_link
.next
= s_link
;
247 v_struct2
.v_int_member
= v_struct1
.v_int_member
;
248 v_union2
.v_short_member
= v_union
.v_short_member
;