4 int main (int argc
, char **argv
, char **envp
)
6 main (argc
, argv
, envp
)
21 /* We put main() right up front so its line number doesn't keep changing. */
24 * Test file with lots of different types, for testing the
29 * First the basic C types.
32 #if !defined (__STDC__) && !defined (_AIX)
37 signed char v_signed_char
;
38 unsigned char v_unsigned_char
;
41 signed short v_signed_short
;
42 unsigned short v_unsigned_short
;
45 signed int v_signed_int
;
46 unsigned int v_unsigned_int
;
49 signed long v_signed_long
;
50 unsigned long v_unsigned_long
;
56 * Now some derived types, which are arrays, functions-returning,
57 * pointers, structures, unions, and enumerations.
63 signed char v_signed_char_array
[2];
64 unsigned char v_unsigned_char_array
[2];
66 short v_short_array
[2];
67 signed short v_signed_short_array
[2];
68 unsigned short v_unsigned_short_array
[2];
71 signed int v_signed_int_array
[2];
72 unsigned int v_unsigned_int_array
[2];
75 signed long v_signed_long_array
[2];
76 unsigned long v_unsigned_long_array
[2];
78 float v_float_array
[2];
79 double v_double_array
[2];
81 /**** pointers *******/
84 signed char *v_signed_char_pointer
;
85 unsigned char *v_unsigned_char_pointer
;
87 short *v_short_pointer
;
88 signed short *v_signed_short_pointer
;
89 unsigned short *v_unsigned_short_pointer
;
92 signed int *v_signed_int_pointer
;
93 unsigned int *v_unsigned_int_pointer
;
96 signed long *v_signed_long_pointer
;
97 unsigned long *v_unsigned_long_pointer
;
99 float *v_float_pointer
;
100 double *v_double_pointer
;
102 /**** structs *******/
106 short v_short_member
;
109 float v_float_member
;
110 double v_double_member
;
115 short v_short_member
;
118 float v_float_member
;
119 double v_double_member
;
122 /**** unions *******/
126 short v_short_member
;
129 float v_float_member
;
130 double v_double_member
;
135 short v_short_member
;
138 float v_float_member
;
139 double v_double_member
;
142 /*** Functions returning type ********/
144 char v_char_func () { return(0); }
145 signed char v_signed_char_func () { return (0); }
146 unsigned char v_unsigned_char_func () { return (0); }
148 short v_short_func () { return (0); }
149 signed short v_signed_short_func () { return (0); }
150 unsigned short v_unsigned_short_func () { return (0); }
152 int v_int_func () { return (0); }
153 signed int v_signed_int_func () { return (0); }
154 unsigned int v_unsigned_int_func () { return (0); }
156 long v_long_func () { return (0); }
157 signed long v_signed_long_func () { return (0); }
158 unsigned long v_unsigned_long_func () { return (0); }
160 float v_float_func () { return (0.0); }
161 double v_double_func () { return (0.0); }
163 /**** Some misc more complicated things *******/
168 struct link
*(*linkfunc
) (struct link
*this, int flags
);
170 struct link
*(*linkfunc
) ();
172 struct t_struct stuff
[1][2][3];
178 struct link
*(*linkfunc
) (struct link
*this, int flags
);
180 struct link
*(*linkfunc
) ();
182 struct t_struct stuff
[1][2][3];
185 /**** Enumerations *******/
187 enum colors
{red
, green
, blue
} color
;
188 enum cars
{chevy
, ford
, porsche
} clunker
;
190 /**** Enumeration bitfields, supported by GNU C *******/
193 enum senum
{sm1
= -1, s1
= 1};
194 struct senum_field
{enum senum field
:2; } sef
;
195 enum uenum
{u1
= 1, u2
= 2};
196 struct uenum_field
{enum uenum field
:2; } uef
;
202 /* setvar.exp wants to allocate memory for constants. So make sure malloc
203 gets linked into the program. */
206 /* Some linkers (e.g. on AIX) remove unreferenced variables,
207 so make sure to reference them. */
214 v_unsigned_short
= 5;
222 v_unsigned_long
= 11;
228 v_char_array
[0] = v_char
;
229 v_signed_char_array
[0] = v_signed_char
;
230 v_unsigned_char_array
[0] = v_unsigned_char
;
232 v_short_array
[0] = v_short
;
233 v_signed_short_array
[0] = v_signed_short
;
234 v_unsigned_short_array
[0] = v_unsigned_short
;
236 v_int_array
[0] = v_int
;
237 v_signed_int_array
[0] = v_signed_int
;
238 v_unsigned_int_array
[0] = v_unsigned_int
;
240 v_long_array
[0] = v_long
;
241 v_signed_long_array
[0] = v_signed_long
;
242 v_unsigned_long_array
[0] = v_unsigned_long
;
244 v_float_array
[0] = v_float
;
245 v_double_array
[0] = v_double
;
247 v_char_pointer
= &v_char
;
248 v_signed_char_pointer
= &v_signed_char
;
249 v_unsigned_char_pointer
= &v_unsigned_char
;
251 v_short_pointer
= &v_short
;
252 v_signed_short_pointer
= &v_signed_short
;
253 v_unsigned_short_pointer
= &v_unsigned_short
;
255 v_int_pointer
= &v_int
;
256 v_signed_int_pointer
= &v_signed_int
;
257 v_unsigned_int_pointer
= &v_unsigned_int
;
259 v_long_pointer
= &v_long
;
260 v_signed_long_pointer
= &v_signed_long
;
261 v_unsigned_long_pointer
= &v_unsigned_long
;
263 v_float_pointer
= &v_float
;
264 v_double_pointer
= &v_double
;
269 u_link
.next
= s_link
;
271 v_struct2
.v_int_member
= v_struct1
.v_int_member
;
272 v_union2
.v_short_member
= v_union
.v_short_member
;
This page took 0.035979 seconds and 5 git commands to generate.