18 __declspec(dllexport) void __stdcall stdcall_fn_1(int i) {
19 printf("stdcall_fn_1(%d)\n", i);
23 __declspec(dllexport) void __stdcall stdcall_fn_2(uint8_t i, float f) {
24 printf("stdcall_fn_2(%d, %.1f)\n", i, f);
28 __declspec(dllexport) void __stdcall stdcall_fn_3(double d) {
29 printf("stdcall_fn_3(%.1f)\n", d);
33 __declspec(dllexport) void __stdcall stdcall_fn_4(uint8_t i, uint8_t j, float f) {
34 printf("stdcall_fn_4(%d, %d, %.1f)\n", i, j, f);
38 __declspec(dllexport) void __stdcall stdcall_fn_5(struct S s, int i) {
39 printf("stdcall_fn_5(S { x: %d, y: %d }, %d)\n", s.x, s.y, i);
43 // Test that stdcall support works correctly with the nullable pointer optimization.
44 __declspec(dllexport) void __stdcall stdcall_fn_6(struct S* s) {
46 printf("stdcall_fn_6(S { x: %d, y: %d })\n", s->x, s->y);
48 printf("stdcall_fn_6(null)\n");
53 __declspec(dllexport) void __stdcall stdcall_fn_7(struct S2 s, int i) {
54 printf("stdcall_fn_7(S2 { x: %d, y: %d }, %d)\n", s.x, s.y, i);
58 // Verify that we compute the correct amount of space in the argument list for a 5-byte struct.
59 __declspec(dllexport) void __stdcall stdcall_fn_8(struct S3 s, struct S3 t) {
60 printf("stdcall_fn_8(S3 { x: [%d, %d, %d, %d, %d] }, S3 { x: [%d, %d, %d, %d, %d] })\n",
61 s.x[0], s.x[1], s.x[2], s.x[3], s.x[4],
62 t.x[0], t.x[1], t.x[2], t.x[3], t.x[4]
67 // test whether f64/double values are aligned on 4-byte or 8-byte boundaries.
68 __declspec(dllexport) void __stdcall stdcall_fn_9(uint8_t x, double y) {
69 printf("stdcall_fn_9(%d, %.1f)\n", x, y);
73 __declspec(dllexport) void __fastcall fastcall_fn_1(int i) {
74 printf("fastcall_fn_1(%d)\n", i);
78 __declspec(dllexport) void __fastcall fastcall_fn_2(uint8_t i, float f) {
79 printf("fastcall_fn_2(%d, %.1f)\n", i, f);
83 __declspec(dllexport) void __fastcall fastcall_fn_3(double d) {
84 printf("fastcall_fn_3(%.1f)\n", d);
88 __declspec(dllexport) void __fastcall fastcall_fn_4(uint8_t i, uint8_t j, float f) {
89 printf("fastcall_fn_4(%d, %d, %.1f)\n", i, j, f);
93 __declspec(dllexport) void __fastcall fastcall_fn_5(struct S s, int i) {
94 printf("fastcall_fn_5(S { x: %d, y: %d }, %d)\n", s.x, s.y, i);
98 __declspec(dllexport) void __fastcall fastcall_fn_6(struct S* s) {
100 printf("fastcall_fn_6(S { x: %d, y: %d })\n", s->x, s->y);
102 printf("fastcall_fn_6(null)\n");
107 __declspec(dllexport) void __fastcall fastcall_fn_7(struct S2 s, int i) {
108 printf("fastcall_fn_7(S2 { x: %d, y: %d }, %d)\n", s.x, s.y, i);
112 __declspec(dllexport) void __fastcall fastcall_fn_8(struct S3 s, struct S3 t) {
113 printf("fastcall_fn_8(S3 { x: [%d, %d, %d, %d, %d] }, S3 { x: [%d, %d, %d, %d, %d] })\n",
114 s.x[0], s.x[1], s.x[2], s.x[3], s.x[4],
115 t.x[0], t.x[1], t.x[2], t.x[3], t.x[4]
120 __declspec(dllexport) void __fastcall fastcall_fn_9(uint8_t x, double y) {
121 printf("fastcall_fn_9(%d, %.1f)\n", x, y);