1 #include "compat-common.h"
4 struct S##TYPE##N { TYPE i[N]; }; \
6 struct S##TYPE##N g1s##TYPE##N, g2s##TYPE##N; \
7 struct S##TYPE##N g3s##TYPE##N, g4s##TYPE##N; \
8 struct S##TYPE##N g5s##TYPE##N, g6s##TYPE##N; \
9 struct S##TYPE##N g7s##TYPE##N, g8s##TYPE##N; \
10 struct S##TYPE##N g9s##TYPE##N, g10s##TYPE##N; \
11 struct S##TYPE##N g11s##TYPE##N, g12s##TYPE##N; \
12 struct S##TYPE##N g13s##TYPE##N, g14s##TYPE##N; \
13 struct S##TYPE##N g15s##TYPE##N, g16s##TYPE##N; \
15 extern void init##TYPE (TYPE *p, int i); \
16 extern void checkg##TYPE##N (void); \
18 test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
19 struct S##TYPE##N s3, struct S##TYPE##N s4, \
20 struct S##TYPE##N s5, struct S##TYPE##N s6, \
21 struct S##TYPE##N s7, struct S##TYPE##N s8, \
22 struct S##TYPE##N s9, struct S##TYPE##N s10, \
23 struct S##TYPE##N s11, struct S##TYPE##N s12, \
24 struct S##TYPE##N s13, struct S##TYPE##N s14, \
25 struct S##TYPE##N s15, struct S##TYPE##N s16); \
26 extern void testva##TYPE##N (int n, ...); \
30 init##TYPE##N (struct S##TYPE##N *p, int i) \
33 for (j = 0; j < N; j++) \
34 init##TYPE(&p->i[j], i+j); \
38 check##TYPE##N (struct S##TYPE##N *p, int i) \
41 for (j = 0; j < N; j++) \
42 check##TYPE(p->i[j], i+j); \
46 test2_##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
47 struct S##TYPE##N s3, struct S##TYPE##N s4, \
48 struct S##TYPE##N s5, struct S##TYPE##N s6, \
49 struct S##TYPE##N s7, struct S##TYPE##N s8) \
51 test##TYPE##N (s1, g2s##TYPE##N, s2, g4s##TYPE##N, \
52 s3, g6s##TYPE##N, s4, g8s##TYPE##N, \
53 s5, g10s##TYPE##N, s6, g12s##TYPE##N, \
54 s7, g14s##TYPE##N, s8, g16s##TYPE##N); \
58 testit##TYPE##N (void) \
60 DEBUG_FPUTS (#TYPE "[" #N "]"); \
61 DEBUG_FPUTS (" init: "); \
62 init##TYPE##N ( &g1s##TYPE##N, 1*16); \
63 init##TYPE##N ( &g2s##TYPE##N, 2*16); \
64 init##TYPE##N ( &g3s##TYPE##N, 3*16); \
65 init##TYPE##N ( &g4s##TYPE##N, 4*16); \
66 init##TYPE##N ( &g5s##TYPE##N, 5*16); \
67 init##TYPE##N ( &g6s##TYPE##N, 6*16); \
68 init##TYPE##N ( &g7s##TYPE##N, 7*16); \
69 init##TYPE##N ( &g8s##TYPE##N, 8*16); \
70 init##TYPE##N ( &g9s##TYPE##N, 9*16); \
71 init##TYPE##N (&g10s##TYPE##N, 10*16); \
72 init##TYPE##N (&g11s##TYPE##N, 11*16); \
73 init##TYPE##N (&g12s##TYPE##N, 12*16); \
74 init##TYPE##N (&g13s##TYPE##N, 13*16); \
75 init##TYPE##N (&g14s##TYPE##N, 14*16); \
76 init##TYPE##N (&g15s##TYPE##N, 15*16); \
77 init##TYPE##N (&g16s##TYPE##N, 16*16); \
80 DEBUG_FPUTS (#TYPE "[" #N "]"); \
81 DEBUG_FPUTS (" test: "); \
82 test##TYPE##N (g1s##TYPE##N, g2s##TYPE##N, \
83 g3s##TYPE##N, g4s##TYPE##N, \
84 g5s##TYPE##N, g6s##TYPE##N, \
85 g7s##TYPE##N, g8s##TYPE##N, \
86 g9s##TYPE##N, g10s##TYPE##N, \
87 g11s##TYPE##N, g12s##TYPE##N, \
88 g13s##TYPE##N, g14s##TYPE##N, \
89 g15s##TYPE##N, g16s##TYPE##N); \
91 DEBUG_FPUTS (#TYPE "[" #N "]"); \
92 DEBUG_FPUTS (" testva:"); \
93 testva##TYPE##N (16, \
94 g1s##TYPE##N, g2s##TYPE##N, \
95 g3s##TYPE##N, g4s##TYPE##N, \
96 g5s##TYPE##N, g6s##TYPE##N, \
97 g7s##TYPE##N, g8s##TYPE##N, \
98 g9s##TYPE##N, g10s##TYPE##N, \
99 g11s##TYPE##N, g12s##TYPE##N, \
100 g13s##TYPE##N, g14s##TYPE##N, \
101 g15s##TYPE##N, g16s##TYPE##N); \
103 DEBUG_FPUTS (#TYPE "[" #N "]"); \
104 DEBUG_FPUTS (" test2: "); \
105 test2_##TYPE##N (g1s##TYPE##N, g3s##TYPE##N, \
106 g5s##TYPE##N, g7s##TYPE##N, \
107 g9s##TYPE##N, g11s##TYPE##N, \
108 g13s##TYPE##N, g15s##TYPE##N); \
112 typedef struct { char c
; } Sc
;
113 typedef struct { short s
; } Ss
;
114 typedef struct { int i
; } Si
;
115 typedef struct { short s
; char c
; } Ssc
;
116 typedef struct { int i
; short s
; } Sis
;
117 typedef struct { char c
; short s
; int i
; } Scsi
;
118 typedef struct { char c
; int i
; short s
; } Scis
;
120 void checkSc (Sc x
, int i
) { if (x
.c
!= i
/16) DEBUG_CHECK
}
121 void checkSs (Ss x
, int i
) { if (x
.s
!= i
) DEBUG_CHECK
}
122 void checkSi (Si x
, int i
) { if (x
.i
!= i
) DEBUG_CHECK
}
123 void checkSsc (Ssc x
, int i
)
124 { if (x
.s
!= i
|| x
.c
!= (i
/16)+1) DEBUG_CHECK
}
125 void checkSis (Sis x
, int i
)
126 { if (x
.i
!= i
|| x
.s
!= i
+1) DEBUG_CHECK
}
127 void checkScsi (Scsi x
, int i
)
128 { if (x
.c
!= i
/16 || x
.s
!= i
+1 || x
.i
!= i
+2) DEBUG_CHECK
}
129 void checkScis (Scis x
, int i
)
130 { if (x
.c
!= i
/16 || x
.i
!= i
+1 || x
.s
!= i
+2) DEBUG_CHECK
}
132 #ifndef SKIP_ZERO_ARRAY
150 #ifndef SKIP_ZERO_ARRAY
172 struct_by_value_8_x ()
176 #define T(N, TYPE) testit##TYPE##N ();
178 #ifndef SKIP_ZERO_ARRAY
196 #ifndef SKIP_ZERO_ARRAY