2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / compat / scalar-return-2_y.c
blob1f7d5493836cf0db708d9f303232ba57ddb8b4bf
1 #include <stdarg.h>
3 #include "compat-common.h"
5 /* Turn off checking for variable arguments with -DSKIPVA. */
6 #ifdef SKIPVA
7 const int test_va = 0;
8 #else
9 const int test_va = 1;
10 #endif
12 #define T(NAME, TYPE, INITVAL) \
13 extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
14 extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
15 extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
16 extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
18 extern void check##NAME (TYPE x, TYPE v); \
20 void \
21 init##NAME (TYPE *p, TYPE v) \
22 { \
23 *p = v + INITVAL; \
24 } \
26 void \
27 checkg##NAME (void) \
28 { \
29 check##NAME (g01##NAME, 1+INITVAL); \
30 check##NAME (g02##NAME, 2+INITVAL); \
31 check##NAME (g03##NAME, 3+INITVAL); \
32 check##NAME (g04##NAME, 4+INITVAL); \
33 check##NAME (g05##NAME, 5+INITVAL); \
34 check##NAME (g06##NAME, 6+INITVAL); \
35 check##NAME (g07##NAME, 7+INITVAL); \
36 check##NAME (g08##NAME, 8+INITVAL); \
37 check##NAME (g09##NAME, 9+INITVAL); \
38 check##NAME (g10##NAME, 10+INITVAL); \
39 check##NAME (g11##NAME, 11+INITVAL); \
40 check##NAME (g12##NAME, 12+INITVAL); \
41 check##NAME (g13##NAME, 13+INITVAL); \
42 check##NAME (g14##NAME, 14+INITVAL); \
43 check##NAME (g15##NAME, 15+INITVAL); \
44 check##NAME (g16##NAME, 16+INITVAL); \
45 } \
47 TYPE \
48 test0##NAME (void) \
49 { \
50 return g01##NAME; \
51 } \
53 TYPE \
54 test1##NAME (TYPE x01) \
55 { \
56 return x01; \
59 T(c, char, 21)
60 T(uc, unsigned char, 22)
61 T(sc, signed char, (-33))
62 T(us, unsigned short, 41)
63 T(ss, short, (-44))
64 T(f, float, 90.0)