1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
/* This is an autogenerated file. Do not edit. */
#include "defines.h"
#include "macros.h"
#include "args.h"
struct IntegerRegisters iregs;
struct FloatRegisters fregs;
unsigned int num_iregs, num_fregs;
/* This struct holds values for argument checking. */
struct
{
int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
} values_int;
struct
{
long i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
} values_long;
void
fun_check_int_passing_int6_values (int i0 ATTRIBUTE_UNUSED, int i1 ATTRIBUTE_UNUSED, int i2 ATTRIBUTE_UNUSED, int i3 ATTRIBUTE_UNUSED, int i4 ATTRIBUTE_UNUSED, int i5 ATTRIBUTE_UNUSED)
{
/* Check argument values. */
assert (values_int.i0 == i0);
assert (values_int.i1 == i1);
assert (values_int.i2 == i2);
assert (values_int.i3 == i3);
assert (values_int.i4 == i4);
assert (values_int.i5 == i5);
}
void
fun_check_int_passing_int6_regs (int i0 ATTRIBUTE_UNUSED, int i1 ATTRIBUTE_UNUSED, int i2 ATTRIBUTE_UNUSED, int i3 ATTRIBUTE_UNUSED, int i4 ATTRIBUTE_UNUSED, int i5 ATTRIBUTE_UNUSED)
{
/* Check register contents. */
check_int_arguments;
}
void
fun_check_int_passing_int12_values (int i0 ATTRIBUTE_UNUSED, int i1 ATTRIBUTE_UNUSED, int i2 ATTRIBUTE_UNUSED, int i3 ATTRIBUTE_UNUSED, int i4 ATTRIBUTE_UNUSED, int i5 ATTRIBUTE_UNUSED, int i6 ATTRIBUTE_UNUSED, int i7 ATTRIBUTE_UNUSED, int i8 ATTRIBUTE_UNUSED, int i9 ATTRIBUTE_UNUSED, int i10 ATTRIBUTE_UNUSED, int i11 ATTRIBUTE_UNUSED)
{
/* Check argument values. */
assert (values_int.i0 == i0);
assert (values_int.i1 == i1);
assert (values_int.i2 == i2);
assert (values_int.i3 == i3);
assert (values_int.i4 == i4);
assert (values_int.i5 == i5);
assert (values_int.i6 == i6);
assert (values_int.i7 == i7);
assert (values_int.i8 == i8);
assert (values_int.i9 == i9);
assert (values_int.i10 == i10);
assert (values_int.i11 == i11);
}
void
fun_check_int_passing_int12_regs (int i0 ATTRIBUTE_UNUSED, int i1 ATTRIBUTE_UNUSED, int i2 ATTRIBUTE_UNUSED, int i3 ATTRIBUTE_UNUSED, int i4 ATTRIBUTE_UNUSED, int i5 ATTRIBUTE_UNUSED, int i6 ATTRIBUTE_UNUSED, int i7 ATTRIBUTE_UNUSED, int i8 ATTRIBUTE_UNUSED, int i9 ATTRIBUTE_UNUSED, int i10 ATTRIBUTE_UNUSED, int i11 ATTRIBUTE_UNUSED)
{
/* Check register contents. */
check_int_arguments;
}
void
fun_check_int_passing_long6_values (long i0 ATTRIBUTE_UNUSED, long i1 ATTRIBUTE_UNUSED, long i2 ATTRIBUTE_UNUSED, long i3 ATTRIBUTE_UNUSED, long i4 ATTRIBUTE_UNUSED, long i5 ATTRIBUTE_UNUSED)
{
/* Check argument values. */
assert (values_long.i0 == i0);
assert (values_long.i1 == i1);
assert (values_long.i2 == i2);
assert (values_long.i3 == i3);
assert (values_long.i4 == i4);
assert (values_long.i5 == i5);
}
void
fun_check_int_passing_long6_regs (long i0 ATTRIBUTE_UNUSED, long i1 ATTRIBUTE_UNUSED, long i2 ATTRIBUTE_UNUSED, long i3 ATTRIBUTE_UNUSED, long i4 ATTRIBUTE_UNUSED, long i5 ATTRIBUTE_UNUSED)
{
/* Check register contents. */
check_long_arguments;
}
void
fun_check_int_passing_long12_values (long i0 ATTRIBUTE_UNUSED, long i1 ATTRIBUTE_UNUSED, long i2 ATTRIBUTE_UNUSED, long i3 ATTRIBUTE_UNUSED, long i4 ATTRIBUTE_UNUSED, long i5 ATTRIBUTE_UNUSED, long i6 ATTRIBUTE_UNUSED, long i7 ATTRIBUTE_UNUSED, long i8 ATTRIBUTE_UNUSED, long i9 ATTRIBUTE_UNUSED, long i10 ATTRIBUTE_UNUSED, long i11 ATTRIBUTE_UNUSED)
{
/* Check argument values. */
assert (values_long.i0 == i0);
assert (values_long.i1 == i1);
assert (values_long.i2 == i2);
assert (values_long.i3 == i3);
assert (values_long.i4 == i4);
assert (values_long.i5 == i5);
assert (values_long.i6 == i6);
assert (values_long.i7 == i7);
assert (values_long.i8 == i8);
assert (values_long.i9 == i9);
assert (values_long.i10 == i10);
assert (values_long.i11 == i11);
}
void
fun_check_int_passing_long12_regs (long i0 ATTRIBUTE_UNUSED, long i1 ATTRIBUTE_UNUSED, long i2 ATTRIBUTE_UNUSED, long i3 ATTRIBUTE_UNUSED, long i4 ATTRIBUTE_UNUSED, long i5 ATTRIBUTE_UNUSED, long i6 ATTRIBUTE_UNUSED, long i7 ATTRIBUTE_UNUSED, long i8 ATTRIBUTE_UNUSED, long i9 ATTRIBUTE_UNUSED, long i10 ATTRIBUTE_UNUSED, long i11 ATTRIBUTE_UNUSED)
{
/* Check register contents. */
check_long_arguments;
}
#define def_check_int_passing6(_i0, _i1, _i2, _i3, _i4, _i5, _func1, _func2, TYPE) \
values_ ## TYPE .i0 = _i0; \
values_ ## TYPE .i1 = _i1; \
values_ ## TYPE .i2 = _i2; \
values_ ## TYPE .i3 = _i3; \
values_ ## TYPE .i4 = _i4; \
values_ ## TYPE .i5 = _i5; \
WRAP_CALL(_func1) (_i0, _i1, _i2, _i3, _i4, _i5); \
\
clear_int_registers; \
iregs.I0 = _i0; \
iregs.I1 = _i1; \
iregs.I2 = _i2; \
iregs.I3 = _i3; \
iregs.I4 = _i4; \
iregs.I5 = _i5; \
num_iregs = 6; \
WRAP_CALL(_func2) (_i0, _i1, _i2, _i3, _i4, _i5);
#define def_check_int_passing12(_i0, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8, _i9, _i10, _i11, _func1, _func2, TYPE) \
values_ ## TYPE .i0 = _i0; \
values_ ## TYPE .i1 = _i1; \
values_ ## TYPE .i2 = _i2; \
values_ ## TYPE .i3 = _i3; \
values_ ## TYPE .i4 = _i4; \
values_ ## TYPE .i5 = _i5; \
values_ ## TYPE .i6 = _i6; \
values_ ## TYPE .i7 = _i7; \
values_ ## TYPE .i8 = _i8; \
values_ ## TYPE .i9 = _i9; \
values_ ## TYPE .i10 = _i10; \
values_ ## TYPE .i11 = _i11; \
WRAP_CALL(_func1) (_i0, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8, _i9, _i10, _i11); \
\
clear_int_registers; \
iregs.I0 = _i0; \
iregs.I1 = _i1; \
iregs.I2 = _i2; \
iregs.I3 = _i3; \
iregs.I4 = _i4; \
iregs.I5 = _i5; \
num_iregs = 6; \
WRAP_CALL(_func2) (_i0, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8, _i9, _i10, _i11);
void
test_ints_on_stack ()
{
def_check_int_passing6(32, 33, 34, 35, 36, 37, fun_check_int_passing_int6_values, fun_check_int_passing_int6_regs, int);
}
void
test_too_many_ints ()
{
def_check_int_passing12(32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, fun_check_int_passing_int12_values, fun_check_int_passing_int12_regs, int);
}
void
test_longs_on_stack ()
{
def_check_int_passing6(32, 33, 34, 35, 36, 37, fun_check_int_passing_long6_values, fun_check_int_passing_long6_regs, long);
}
void
test_too_many_longs ()
{
def_check_int_passing12(32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, fun_check_int_passing_long12_values, fun_check_int_passing_long12_regs, long);
}
void
test_int128s_on_stack ()
{
}
void
test_too_many_int128s ()
{
}
int
main (void)
{
test_ints_on_stack ();
test_too_many_ints ();
test_longs_on_stack ();
test_too_many_longs ();
test_int128s_on_stack ();
test_too_many_int128s ();
return 0;
}
|