Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / compat / struct-by-value-10_y.c
blob6c9589d029d471da70115700a2469ebe455d4791
1 #include <stdarg.h>
3 #include "compat-common.h"
5 #ifdef SKIP_VA
6 const int test_va = 0;
7 #else
8 const int test_va = 1;
9 #endif
11 #include "fp2-struct-defs.h"
12 #include "fp2-struct-init.h"
14 #define TEST(TYPE) \
15 extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
16 extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
17 extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
18 extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
20 extern void check##TYPE (TYPE x, double y); \
22 void \
23 checkg##TYPE (void) \
24 { \
25 check##TYPE ( g1s##TYPE, (double)1); \
26 check##TYPE ( g2s##TYPE, (double)2); \
27 check##TYPE ( g3s##TYPE, (double)3); \
28 check##TYPE ( g4s##TYPE, (double)4); \
29 check##TYPE ( g5s##TYPE, (double)5); \
30 check##TYPE ( g6s##TYPE, (double)6); \
31 check##TYPE ( g7s##TYPE, (double)7); \
32 check##TYPE ( g8s##TYPE, (double)8); \
33 check##TYPE ( g9s##TYPE, (double)9); \
34 check##TYPE ( g10s##TYPE, (double)10); \
35 check##TYPE ( g11s##TYPE, (double)11); \
36 check##TYPE ( g12s##TYPE, (double)12); \
37 check##TYPE ( g13s##TYPE, (double)13); \
38 check##TYPE ( g14s##TYPE, (double)14); \
39 check##TYPE ( g15s##TYPE, (double)15); \
40 check##TYPE ( g16s##TYPE, (double)16); \
41 } \
43 void \
44 test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
45 TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
46 TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
47 TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
48 { \
49 check##TYPE (s1, (double)1); \
50 check##TYPE (s2, (double)2); \
51 check##TYPE (s3, (double)3); \
52 check##TYPE (s4, (double)4); \
53 check##TYPE (s5, (double)5); \
54 check##TYPE (s6, (double)6); \
55 check##TYPE (s7, (double)7); \
56 check##TYPE (s8, (double)8); \
57 check##TYPE (s9, (double)9); \
58 check##TYPE (s10, (double)10); \
59 check##TYPE (s11, (double)11); \
60 check##TYPE (s12, (double)12); \
61 check##TYPE (s13, (double)13); \
62 check##TYPE (s14, (double)14); \
63 check##TYPE (s15, (double)15); \
64 check##TYPE (s16, (double)16); \
65 } \
67 void \
68 testva##TYPE (int n, ...) \
69 { \
70 int i; \
71 va_list ap; \
72 if (test_va) \
73 { \
74 va_start (ap, n); \
75 for (i = 0; i < n; i++) \
76 { \
77 TYPE t = va_arg (ap, TYPE); \
78 check##TYPE (t, (double)i+1); \
79 } \
80 va_end (ap); \
81 } \
84 TEST(Sfd)
85 TEST(Sfl)
86 TEST(Sdf)
87 TEST(Sdl)
88 TEST(Slf)
89 TEST(Sld)
90 TEST(Sfdl)
91 TEST(Sfld)
92 TEST(Sdfl)
93 TEST(Sdlf)
94 TEST(Slfd)
95 TEST(Sldf)