1 main (argc
, argv
, envp
)
10 /* We put main() right up front so its line number doesn't keep changing. */
13 * Test file with lots of different types, for testing the
18 * First the basic C types.
21 #if !defined (__STDC__) && !defined (_AIX)
26 signed char v_signed_char
;
27 unsigned char v_unsigned_char
;
30 signed short v_signed_short
;
31 unsigned short v_unsigned_short
;
34 signed int v_signed_int
;
35 unsigned int v_unsigned_int
;
38 signed long v_signed_long
;
39 unsigned long v_unsigned_long
;
45 * Now some derived types, which are arrays, functions-returning,
46 * pointers, structures, unions, and enumerations.
52 signed char v_signed_char_array
[2];
53 unsigned char v_unsigned_char_array
[2];
55 short v_short_array
[2];
56 signed short v_signed_short_array
[2];
57 unsigned short v_unsigned_short_array
[2];
60 signed int v_signed_int_array
[2];
61 unsigned int v_unsigned_int_array
[2];
64 signed long v_signed_long_array
[2];
65 unsigned long v_unsigned_long_array
[2];
67 float v_float_array
[2];
68 double v_double_array
[2];
70 /**** pointers *******/
73 signed char *v_signed_char_pointer
;
74 unsigned char *v_unsigned_char_pointer
;
76 short *v_short_pointer
;
77 signed short *v_signed_short_pointer
;
78 unsigned short *v_unsigned_short_pointer
;
81 signed int *v_signed_int_pointer
;
82 unsigned int *v_unsigned_int_pointer
;
85 signed long *v_signed_long_pointer
;
86 unsigned long *v_unsigned_long_pointer
;
88 float *v_float_pointer
;
89 double *v_double_pointer
;
91 /**** structs *******/
99 double v_double_member
;
104 short v_short_member
;
107 float v_float_member
;
108 double v_double_member
;
111 /**** unions *******/
115 short v_short_member
;
118 float v_float_member
;
119 double v_double_member
;
124 short v_short_member
;
127 float v_float_member
;
128 double v_double_member
;
131 /*** Functions returning type ********/
133 char v_char_func () { return(0); }
134 signed char v_signed_char_func () { return (0); }
135 unsigned char v_unsigned_char_func () { return (0); }
137 short v_short_func () { return (0); }
138 signed short v_signed_short_func () { return (0); }
139 unsigned short v_unsigned_short_func () { return (0); }
141 int v_int_func () { return (0); }
142 signed int v_signed_int_func () { return (0); }
143 unsigned int v_unsigned_int_func () { return (0); }
145 long v_long_func () { return (0); }
146 signed long v_signed_long_func () { return (0); }
147 unsigned long v_unsigned_long_func () { return (0); }
149 float v_float_func () { return (0.0); }
150 double v_double_func () { return (0.0); }
152 /**** Some misc more complicated things *******/
157 struct link
*(*linkfunc
) (struct link
*this, int flags
);
159 struct link
*(*linkfunc
) ();
161 struct t_struct stuff
[1][2][3];
167 struct link
*(*linkfunc
) (struct link
*this, int flags
);
169 struct link
*(*linkfunc
) ();
171 struct t_struct stuff
[1][2][3];
174 /**** Enumerations *******/
176 enum colors
{red
, green
, blue
} color
;
177 enum cars
{chevy
, ford
, porsche
} clunker
;
181 /* Some linkers (e.g. on AIX) remove unreferenced variables,
182 so make sure to reference them. */
189 v_unsigned_short
= 5;
197 v_unsigned_long
= 11;
203 v_char_array
[0] = v_char
;
204 v_signed_char_array
[0] = v_signed_char
;
205 v_unsigned_char_array
[0] = v_unsigned_char
;
207 v_short_array
[0] = v_short
;
208 v_signed_short_array
[0] = v_signed_short
;
209 v_unsigned_short_array
[0] = v_unsigned_short
;
211 v_int_array
[0] = v_int
;
212 v_signed_int_array
[0] = v_signed_int
;
213 v_unsigned_int_array
[0] = v_unsigned_int
;
215 v_long_array
[0] = v_long
;
216 v_signed_long_array
[0] = v_signed_long
;
217 v_unsigned_long_array
[0] = v_unsigned_long
;
219 v_float_array
[0] = v_float
;
220 v_double_array
[0] = v_double
;
222 v_char_pointer
= &v_char
;
223 v_signed_char_pointer
= &v_signed_char
;
224 v_unsigned_char_pointer
= &v_unsigned_char
;
226 v_short_pointer
= &v_short
;
227 v_signed_short_pointer
= &v_signed_short
;
228 v_unsigned_short_pointer
= &v_unsigned_short
;
230 v_int_pointer
= &v_int
;
231 v_signed_int_pointer
= &v_signed_int
;
232 v_unsigned_int_pointer
= &v_unsigned_int
;
234 v_long_pointer
= &v_long
;
235 v_signed_long_pointer
= &v_signed_long
;
236 v_unsigned_long_pointer
= &v_unsigned_long
;
238 v_float_pointer
= &v_float
;
239 v_double_pointer
= &v_double
;
244 u_link
.next
= s_link
;
246 v_struct2
.v_int_member
= v_struct1
.v_int_member
;
247 v_union2
.v_short_member
= v_union
.v_short_member
;
This page took 0.033847 seconds and 4 git commands to generate.