1// Copyright (c) Microsoft. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4#include <stdint.h>
5
6#ifdef _MSC_VER
7#define DLLEXPORT __declspec(dllexport)
8#else
9#define DLLEXPORT __attribute__((visibility("default")))
10#endif // _MSC_VER
11
12struct SingleByte
13{
14 uint8_t Byte;
15};
16
17struct SingleLong
18{
19 uint64_t Long;
20};
21
22struct SingleFloat
23{
24 float Float;
25};
26
27struct SingleDouble
28{
29 double Double;
30};
31
32struct ByteAndFloat
33{
34 uint8_t Byte;
35 float Float;
36};
37
38struct FloatAndByte
39{
40 float Float;
41 uint8_t Byte;
42};
43
44struct LongAndFloat
45{
46 uint64_t Long;
47 float Float;
48};
49
50struct ByteAndDouble
51{
52 uint8_t Byte;
53 double Double;
54};
55
56struct DoubleAndByte
57{
58 double Double;
59 uint8_t Byte;
60};
61
62struct PointerAndByte
63{
64 void* Pointer;
65 uint8_t Byte;
66};
67
68struct ByteAndPointer
69{
70 uint8_t Byte;
71 void* Pointer;
72};
73
74struct ByteFloatAndPointer
75{
76 uint8_t Byte;
77 float Float;
78 void* Pointer;
79};
80
81struct PointerFloatAndByte
82{
83 void* Pointer;
84 float Float;
85 uint8_t Byte;
86};
87
88struct ShortIntFloatIntPtr
89{
90 __int16 Short;
91 __int32 Int;
92 float Float;
93 __int32* Pointer;
94};
95
96struct TwoLongs
97{
98 uint64_t Long1;
99 uint64_t Long2;
100};
101
102struct TwoFloats
103{
104 float Float1;
105 float Float2;
106};
107
108struct TwoDoubles
109{
110 double Double1;
111 double Double2;
112};
113
114struct FourLongs
115{
116 uint64_t Long1;
117 uint64_t Long2;
118 uint64_t Long3;
119 uint64_t Long4;
120};
121
122struct FourDoubles
123{
124 double Double1;
125 double Double2;
126 double Double3;
127 double Double4;
128};
129
130struct InlineArray1
131{
132 uint8_t Array[16];
133};
134
135struct InlineArray2
136{
137 float Array[4];
138};
139
140struct InlineArray3
141{
142 float Array[3];
143};
144
145struct InlineArray4
146{
147 uint16_t Array[5];
148};
149
150struct InlineArray5
151{
152 uint8_t Array[9];
153};
154
155struct InlineArray6
156{
157 double Array[1];
158};
159
160struct Nested1
161{
162 struct LongAndFloat Field1;
163 struct LongAndFloat Field2;
164};
165
166struct Nested2
167{
168 struct ByteAndFloat Field1;
169 struct FloatAndByte Field2;
170};
171
172struct Nested3
173{
174 void* Field1;
175 struct FloatAndByte Field2;
176};
177
178struct Nested4
179{
180 struct InlineArray5 Field1;
181 uint16_t Field2;
182};
183
184struct Nested5
185{
186 uint16_t Field1;
187 struct InlineArray5 Field2;
188};
189
190struct Nested6
191{
192 struct InlineArray4 Field1;
193 uint32_t Field2;
194};
195
196struct Nested7
197{
198 uint32_t Field1;
199 struct InlineArray4 Field2;
200};
201
202struct Nested8
203{
204 struct InlineArray4 Field1;
205 uint16_t Field2;
206};
207
208struct Nested9
209{
210 uint16_t Field1;
211 struct InlineArray4 Field2;
212};
213
214DLLEXPORT struct SingleByte EchoSingleByte(struct SingleByte value)
215{
216 return value;
217}
218
219DLLEXPORT struct SingleLong EchoSingleLong(struct SingleLong value)
220{
221 return value;
222}
223
224DLLEXPORT struct SingleFloat EchoSingleFloat(struct SingleFloat value)
225{
226 return value;
227}
228
229DLLEXPORT struct SingleDouble EchoSingleDouble(struct SingleDouble value)
230{
231 return value;
232}
233
234DLLEXPORT struct ByteAndFloat EchoByteAndFloat(struct ByteAndFloat value)
235{
236 return value;
237}
238
239DLLEXPORT struct LongAndFloat EchoLongAndFloat(struct LongAndFloat value)
240{
241 return value;
242}
243
244DLLEXPORT struct ByteAndDouble EchoByteAndDouble(struct ByteAndDouble value)
245{
246 return value;
247}
248
249DLLEXPORT struct DoubleAndByte EchoDoubleAndByte(struct DoubleAndByte value)
250{
251 return value;
252}
253
254DLLEXPORT struct PointerAndByte EchoPointerAndByte(struct PointerAndByte value)
255{
256 return value;
257}
258
259DLLEXPORT struct ByteAndPointer EchoByteAndPointer(struct ByteAndPointer value)
260{
261 return value;
262}
263
264DLLEXPORT struct ByteFloatAndPointer EchoByteFloatAndPointer(struct ByteFloatAndPointer value)
265{
266 return value;
267}
268
269DLLEXPORT struct PointerFloatAndByte EchoPointerFloatAndByte(struct PointerFloatAndByte value)
270{
271 return value;
272}
273
274DLLEXPORT struct ShortIntFloatIntPtr EchoShortIntFloatIntPtr(struct ShortIntFloatIntPtr value)
275{
276 return value;
277}
278
279DLLEXPORT struct TwoLongs EchoTwoLongs(struct TwoLongs value)
280{
281 return value;
282}
283
284DLLEXPORT struct TwoFloats EchoTwoFloats(struct TwoFloats value)
285{
286 return value;
287}
288
289DLLEXPORT struct TwoDoubles EchoTwoDoubles(struct TwoDoubles value)
290{
291 return value;
292}
293
294DLLEXPORT struct FourLongs EchoFourLongs(struct FourLongs value)
295{
296 return value;
297}
298
299DLLEXPORT struct FourDoubles EchoFourDoubles(struct FourDoubles value)
300{
301 return value;
302}
303
304DLLEXPORT struct InlineArray1 EchoInlineArray1(struct InlineArray1 value)
305{
306 return value;
307}
308
309DLLEXPORT struct InlineArray2 EchoInlineArray2(struct InlineArray2 value)
310{
311 return value;
312}
313
314DLLEXPORT struct InlineArray3 EchoInlineArray3(struct InlineArray3 value)
315{
316 return value;
317}
318
319DLLEXPORT struct InlineArray4 EchoInlineArray4(struct InlineArray4 value)
320{
321 return value;
322}
323
324DLLEXPORT struct InlineArray5 EchoInlineArray5(struct InlineArray5 value)
325{
326 return value;
327}
328
329DLLEXPORT struct InlineArray6 EchoInlineArray6(struct InlineArray6 value)
330{
331 return value;
332}
333
334DLLEXPORT struct Nested1 EchoNested1(struct Nested1 value)
335{
336 return value;
337}
338
339DLLEXPORT struct Nested2 EchoNested2(struct Nested2 value)
340{
341 return value;
342}
343
344DLLEXPORT struct Nested3 EchoNested3(struct Nested3 value)
345{
346 return value;
347}
348
349DLLEXPORT struct Nested4 EchoNested4(struct Nested4 value)
350{
351 return value;
352}
353
354DLLEXPORT struct Nested5 EchoNested5(struct Nested5 value)
355{
356 return value;
357}
358
359DLLEXPORT struct Nested6 EchoNested6(struct Nested6 value)
360{
361 return value;
362}
363
364DLLEXPORT struct Nested7 EchoNested7(struct Nested7 value)
365{
366 return value;
367}
368
369DLLEXPORT struct Nested8 EchoNested8(struct Nested8 value)
370{
371 return value;
372}
373
374DLLEXPORT struct Nested9 EchoNested9(struct Nested9 value)
375{
376 return value;
377}
378
379DLLEXPORT struct TwoLongs NotEnoughRegistersSysV1(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, uint64_t f, struct TwoLongs value)
380{
381 return value;
382}
383
384DLLEXPORT struct TwoLongs NotEnoughRegistersSysV2(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, struct TwoLongs value)
385{
386 return value;
387}
388
389DLLEXPORT struct DoubleAndByte NotEnoughRegistersSysV3(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, uint64_t f, struct DoubleAndByte value)
390{
391 return value;
392}
393
394DLLEXPORT struct TwoDoubles NotEnoughRegistersSysV4(double a, double b, double c, double d, double e, double f, double g, double h, struct TwoDoubles value)
395{
396 return value;
397}
398
399DLLEXPORT struct TwoDoubles NotEnoughRegistersSysV5(double a, double b, double c, double d, double e, double f, double g, struct TwoDoubles value)
400{
401 return value;
402}
403
404DLLEXPORT struct DoubleAndByte NotEnoughRegistersSysV6(double a, double b, double c, double d, double e, double f, double g, double h, struct DoubleAndByte value)
405{
406 return value;
407}
408
409DLLEXPORT struct TwoDoubles EnoughRegistersSysV1(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, uint64_t f, struct TwoDoubles value)
410{
411 return value;
412}
413
414DLLEXPORT struct DoubleAndByte EnoughRegistersSysV2(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, struct DoubleAndByte value)
415{
416 return value;
417}
418
419DLLEXPORT struct TwoLongs EnoughRegistersSysV3(double a, double b, double c, double d, double e, double f, double g, double h, struct TwoLongs value)
420{
421 return value;
422}
423
424DLLEXPORT struct DoubleAndByte EnoughRegistersSysV4(double a, double b, double c, double d, double e, double f, double g, struct DoubleAndByte value)
425{
426 return value;
427}
428