2 int main (int argc, char **argv, char **envp)
4 main (argc, argv, envp)
20 /* We put main() right up front so its line number doesn't keep changing. */
23 * Test file with lots of different types, for testing the
28 * First the basic C types.
31 #if !defined (__STDC__) && !defined (_AIX)
36 signed char v_signed_char;
37 unsigned char v_unsigned_char;
40 signed short v_signed_short;
41 unsigned short v_unsigned_short;
44 signed int v_signed_int;
45 unsigned int v_unsigned_int;
48 signed long v_signed_long;
49 unsigned long v_unsigned_long;
54 * Now some derived types, which are arrays, functions-returning,
55 * pointers, structures, unions, and enumerations.
61 signed char v_signed_char_array[2];
62 unsigned char v_unsigned_char_array[2];
64 short v_short_array[2];
65 signed short v_signed_short_array[2];
66 unsigned short v_unsigned_short_array[2];
69 signed int v_signed_int_array[2];
70 unsigned int v_unsigned_int_array[2];
73 signed long v_signed_long_array[2];
74 unsigned long v_unsigned_long_array[2];
76 float v_float_array[2];
77 double v_double_array[2];
78 /**** pointers *******/
81 signed char *v_signed_char_pointer;
82 unsigned char *v_unsigned_char_pointer;
84 short *v_short_pointer;
85 signed short *v_signed_short_pointer;
86 unsigned short *v_unsigned_short_pointer;
89 signed int *v_signed_int_pointer;
90 unsigned int *v_unsigned_int_pointer;
93 signed long *v_signed_long_pointer;
94 unsigned long *v_unsigned_long_pointer;
96 float *v_float_pointer;
97 double *v_double_pointer;
99 /**** structs *******/
103 short v_short_member;
106 float v_float_member;
107 double v_double_member;
112 short v_short_member;
115 float v_float_member;
116 double v_double_member;
119 /**** unions *******/
123 short v_short_member;
126 float v_float_member;
127 double v_double_member;
132 short v_short_member;
135 float v_float_member;
136 double v_double_member;
139 /*** Functions returning type ********/
141 char v_char_func () { return(0); }
142 signed char v_signed_char_func () { return (0); }
143 unsigned char v_unsigned_char_func () { return (0); }
145 short v_short_func () { return (0); }
146 signed short v_signed_short_func () { return (0); }
147 unsigned short v_unsigned_short_func () { return (0); }
149 int v_int_func () { return (0); }
150 signed int v_signed_int_func () { return (0); }
151 unsigned int v_unsigned_int_func () { return (0); }
153 long v_long_func () { return (0); }
154 signed long v_signed_long_func () { return (0); }
155 unsigned long v_unsigned_long_func () { return (0); }
157 float v_float_func () { return (0.0); }
158 double v_double_func () { return (0.0); }
160 /**** Some misc more complicated things *******/
165 struct link *(*linkfunc) (struct link *this, int flags);
167 struct link *(*linkfunc) ();
169 struct t_struct stuff[1][2][3];
175 struct link *(*linkfunc) (struct link *this, int flags);
177 struct link *(*linkfunc) ();
179 struct t_struct stuff[1][2][3];
182 /**** Enumerations *******/
184 enum colors {red, green, blue} color;
185 enum cars {chevy, ford, porsche} clunker;
190 /* Some linkers (e.g. on AIX) remove unreferenced variables,
191 so make sure to reference them. */
198 v_unsigned_short = 5;
206 v_unsigned_long = 11;
210 v_char_array[0] = v_char;
211 v_signed_char_array[0] = v_signed_char;
212 v_unsigned_char_array[0] = v_unsigned_char;
214 v_short_array[0] = v_short;
215 v_signed_short_array[0] = v_signed_short;
216 v_unsigned_short_array[0] = v_unsigned_short;
218 v_int_array[0] = v_int;
219 v_signed_int_array[0] = v_signed_int;
220 v_unsigned_int_array[0] = v_unsigned_int;
222 v_long_array[0] = v_long;
223 v_signed_long_array[0] = v_signed_long;
224 v_unsigned_long_array[0] = v_unsigned_long;
226 v_float_array[0] = v_float;
227 v_double_array[0] = v_double;
228 v_char_pointer = &v_char;
229 v_signed_char_pointer = &v_signed_char;
230 v_unsigned_char_pointer = &v_unsigned_char;
232 v_short_pointer = &v_short;
233 v_signed_short_pointer = &v_signed_short;
234 v_unsigned_short_pointer = &v_unsigned_short;
236 v_int_pointer = &v_int;
237 v_signed_int_pointer = &v_signed_int;
238 v_unsigned_int_pointer = &v_unsigned_int;
240 v_long_pointer = &v_long;
241 v_signed_long_pointer = &v_signed_long;
242 v_unsigned_long_pointer = &v_unsigned_long;
244 v_float_pointer = &v_float;
245 v_double_pointer = &v_double;
250 u_link.next = s_link;
252 v_struct2.v_int_member = v_struct1.v_int_member;
253 v_union2.v_short_member = v_union.v_short_member;