summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-03-24 15:14:33 -0700
committerJan Kotas <jkotas@microsoft.com>2016-03-24 15:14:33 -0700
commit905046b8928716e050ab2c9b3f57518e604d4791 (patch)
tree03971c87e935ef83f67b8de511a2a1ddeedb7ef4
parente02c359a66219e4021ecb614cff87bb6a07bd68e (diff)
downloadcoreclr-905046b8928716e050ab2c9b3f57518e604d4791.tar.gz
coreclr-905046b8928716e050ab2c9b3f57518e604d4791.tar.bz2
coreclr-905046b8928716e050ab2c9b3f57518e604d4791.zip
Add explicit calling convention modifiers for x86
-rw-r--r--tests/src/JIT/Methodical/structs/systemvbringup/structinregs.cpp150
1 files changed, 79 insertions, 71 deletions
diff --git a/tests/src/JIT/Methodical/structs/systemvbringup/structinregs.cpp b/tests/src/JIT/Methodical/structs/systemvbringup/structinregs.cpp
index a01e93034b..2fa30eb5c1 100644
--- a/tests/src/JIT/Methodical/structs/systemvbringup/structinregs.cpp
+++ b/tests/src/JIT/Methodical/structs/systemvbringup/structinregs.cpp
@@ -6,6 +6,14 @@
#define EXPORT(type) type
#endif
+#ifndef _MSCVER
+#if __i386__
+#define __stdcall __attribute__((stdcall))
+#else
+#define __stdcall
+#endif
+#endif
+
typedef unsigned char byte;
struct S1
@@ -182,131 +190,131 @@ struct S30
long long x;
long long y;
};
-
-typedef void* (*PFNACTION1)(S1 s);
-typedef void* (*PFNACTION2)(S2 s);
-typedef void* (*PFNACTION3)(S3 s);
-typedef void* (*PFNACTION4)(S4 s);
-typedef void* (*PFNACTION5)(S5 s);
-typedef void* (*PFNACTION6)(S6 s);
-typedef void* (*PFNACTION7)(S7 s);
-typedef void* (*PFNACTION8)(S8 s);
-typedef void* (*PFNACTION9)(S9 s);
-typedef void* (*PFNACTION10)(S10 s);
-typedef void* (*PFNACTION11)(S11 s);
-typedef void* (*PFNACTION12)(S12 s);
-typedef void* (*PFNACTION13)(S13 s);
-typedef void* (*PFNACTION14)(S14 s);
-typedef void* (*PFNACTION15)(S15 s);
-typedef void* (*PFNACTION16)(S16 s);
-typedef void* (*PFNACTION17)(S17 s);
-typedef void* (*PFNACTION18)(S18 s);
-typedef void* (*PFNACTION19)(S19 s);
-typedef void* (*PFNACTION20)(S20 s);
-
-typedef void* (*PFNACTION28)(S28 s);
-typedef void* (*PFNACTION29)(S29 s);
-typedef void (*PFNACTION30)(S30 s1, S30 s2, S30 s3);
-
-EXPORT(void) InvokeCallback1(PFNACTION1 callback, S1 s)
+
+typedef void* (__stdcall *PFNACTION1)(S1 s);
+typedef void* (__stdcall *PFNACTION2)(S2 s);
+typedef void* (__stdcall *PFNACTION3)(S3 s);
+typedef void* (__stdcall *PFNACTION4)(S4 s);
+typedef void* (__stdcall *PFNACTION5)(S5 s);
+typedef void* (__stdcall *PFNACTION6)(S6 s);
+typedef void* (__stdcall *PFNACTION7)(S7 s);
+typedef void* (__stdcall *PFNACTION8)(S8 s);
+typedef void* (__stdcall *PFNACTION9)(S9 s);
+typedef void* (__stdcall *PFNACTION10)(S10 s);
+typedef void* (__stdcall *PFNACTION11)(S11 s);
+typedef void* (__stdcall *PFNACTION12)(S12 s);
+typedef void* (__stdcall *PFNACTION13)(S13 s);
+typedef void* (__stdcall *PFNACTION14)(S14 s);
+typedef void* (__stdcall *PFNACTION15)(S15 s);
+typedef void* (__stdcall *PFNACTION16)(S16 s);
+typedef void* (__stdcall *PFNACTION17)(S17 s);
+typedef void* (__stdcall *PFNACTION18)(S18 s);
+typedef void* (__stdcall *PFNACTION19)(S19 s);
+typedef void* (__stdcall *PFNACTION20)(S20 s);
+
+typedef void* (__stdcall *PFNACTION28)(S28 s);
+typedef void* (__stdcall *PFNACTION29)(S29 s);
+typedef void (__stdcall *PFNACTION30)(S30 s1, S30 s2, S30 s3);
+
+EXPORT(void) __stdcall InvokeCallback1(PFNACTION1 callback, S1 s)
{
printf("Native S1: %d, %d, %d, %d\n", s.x, s.y, s.z, s.w);
callback(s);
}
-EXPORT(void) InvokeCallback2(PFNACTION2 callback, S2 s)
+EXPORT(void) __stdcall InvokeCallback2(PFNACTION2 callback, S2 s)
{
printf("Native S2: %d, %d, %f\n", s.x, s.y, s.z);
callback(s);
}
-EXPORT(void) InvokeCallback3(PFNACTION3 callback, S3 s)
+EXPORT(void) __stdcall InvokeCallback3(PFNACTION3 callback, S3 s)
{
printf("Native S3: %d, %d, %f\n", s.x, s.y, s.z);
callback(s);
}
-EXPORT(void) InvokeCallback4(PFNACTION4 callback, S4 s)
+EXPORT(void) __stdcall InvokeCallback4(PFNACTION4 callback, S4 s)
{
printf("Native S4: %d, %f\n", s.x, s.y);
callback(s);
}
-EXPORT(void) InvokeCallback5(PFNACTION5 callback, S5 s)
+EXPORT(void) __stdcall InvokeCallback5(PFNACTION5 callback, S5 s)
{
printf("Native S5: %d, %f\n", s.x, s.y);
callback(s);
}
-EXPORT(void) InvokeCallback6(PFNACTION6 callback, S6 s)
+EXPORT(void) __stdcall InvokeCallback6(PFNACTION6 callback, S6 s)
{
printf("Native S6: %hd, %hd, %d, %d\n", s.x, s.y, s.z, s.w);
callback(s);
}
-EXPORT(void) InvokeCallback7(PFNACTION7 callback, S7 s)
+EXPORT(void) __stdcall InvokeCallback7(PFNACTION7 callback, S7 s)
{
printf("Native S7: %f, %d, %d\n", s.x, s.y, s.z);
callback(s);
}
-EXPORT(void) InvokeCallback8(PFNACTION8 callback, S8 s)
+EXPORT(void) __stdcall InvokeCallback8(PFNACTION8 callback, S8 s)
{
printf("Native S8: %f, %d\n", s.x, s.y);
callback(s);
}
-EXPORT(void) InvokeCallback9(PFNACTION9 callback, S9 s)
+EXPORT(void) __stdcall InvokeCallback9(PFNACTION9 callback, S9 s)
{
printf("Native S9: %d, %d, %f, %f\n", s.x, s.y, s.z, s.w);
callback(s);
}
-EXPORT(void) InvokeCallback10(PFNACTION10 callback, S10 s)
+EXPORT(void) __stdcall InvokeCallback10(PFNACTION10 callback, S10 s)
{
printf("Native S10: %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd\n", s.a, s.b, s.c, s.d, s.e, s.f, s.g, s.h);
callback(s);
}
-EXPORT(void) InvokeCallback11(PFNACTION11 callback, S11 s)
+EXPORT(void) __stdcall InvokeCallback11(PFNACTION11 callback, S11 s)
{
printf("Native S11: %hhd, %hhd, %hhd, %hhd, %f\n", s.a, s.b, s.c, s.d, s.e);
callback(s);
}
-EXPORT(void) InvokeCallback12(PFNACTION12 callback, S12 s)
+EXPORT(void) __stdcall InvokeCallback12(PFNACTION12 callback, S12 s)
{
printf("Native S12: %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %lld\n", s.a, s.b, s.c, s.d, s.e, s.f, s.g, s.h, s.i);
callback(s);
}
-EXPORT(void) InvokeCallback13(PFNACTION13 callback, S13 s)
+EXPORT(void) __stdcall InvokeCallback13(PFNACTION13 callback, S13 s)
{
printf("Native S13: %hhd, %d\n", s.hasValue, s.x);
callback(s);
}
-EXPORT(void) InvokeCallback14(PFNACTION14 callback, S14 s)
+EXPORT(void) __stdcall InvokeCallback14(PFNACTION14 callback, S14 s)
{
printf("Native S13: %hhd, %lld\n", s.x, s.y);
callback(s);
}
-EXPORT(void) InvokeCallback15(PFNACTION15 callback, S15 s)
+EXPORT(void) __stdcall InvokeCallback15(PFNACTION15 callback, S15 s)
{
printf("Native S15: %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd\n", s.a, s.b, s.c, s.d, s.e, s.f, s.g, s.h, s.i);
callback(s);
}
-EXPORT(void) InvokeCallback16(PFNACTION16 callback, S16 s)
+EXPORT(void) __stdcall InvokeCallback16(PFNACTION16 callback, S16 s)
{
printf("Native S16: %hhd, %hd\n", s.x, s.y);
callback(s);
}
-EXPORT(void) InvokeCallback17(PFNACTION17 callback, S17 s)
+EXPORT(void) __stdcall InvokeCallback17(PFNACTION17 callback, S17 s)
{
printf("Native S17: %f, %f\n", s.x, s.y);
callback(s);
}
-EXPORT(void) InvokeCallback18(PFNACTION18 callback, S18 s)
+EXPORT(void) __stdcall InvokeCallback18(PFNACTION18 callback, S18 s)
{
printf("Native S18: %f, %d, %f\n", s.x, s.y, s.z);
callback(s);
}
-EXPORT(void) InvokeCallback19(PFNACTION19 callback, S19 s)
+EXPORT(void) __stdcall InvokeCallback19(PFNACTION19 callback, S19 s)
{
printf("Native S19: %d, %f, %d, %f\n", s.x, s.y, s.z, s.w);
callback(s);
}
-EXPORT(void) InvokeCallback20(PFNACTION20 callback, S20 s)
+EXPORT(void) __stdcall InvokeCallback20(PFNACTION20 callback, S20 s)
{
#ifdef __clang__
printf("Native S20: %lld, %lld, %lld, %lld\n", s.x, s.y, s.z, s.w);
@@ -317,140 +325,140 @@ EXPORT(void) InvokeCallback20(PFNACTION20 callback, S20 s)
callback(s);
}
-EXPORT(void) InvokeCallback28(PFNACTION28 callback, S28 s)
+EXPORT(void) __stdcall InvokeCallback28(PFNACTION28 callback, S28 s)
{
printf("Native S28: %p object, %d\n", s.x, s.y);
callback(s);
}
-EXPORT(void) InvokeCallback29(PFNACTION29 callback, S29 s)
+EXPORT(void) __stdcall InvokeCallback29(PFNACTION29 callback, S29 s)
{
printf("Native S29: %d, %p object\n", s.x, s.y);
callback(s);
}
-EXPORT(void) InvokeCallback30(PFNACTION30 callback, S30 s1, S30 s2, S30 s3)
+EXPORT(void) __stdcall InvokeCallback30(PFNACTION30 callback, S30 s1, S30 s2, S30 s3)
{
printf("Native S30: %lld, %lld, %lld, %lld, %lld, %lld\n", s1.x, s1.y, s2.x, s2.y, s3.x, s3.y);
callback(s1, s2, s3);
}
-EXPORT(S1) InvokeCallback1R(PFNACTION1 callback, S1 s)
+EXPORT(S1) __stdcall InvokeCallback1R(PFNACTION1 callback, S1 s)
{
printf("Native S1: %d, %d, %d, %d\n", s.x, s.y, s.z, s.w);
callback(s);
return s;
}
-EXPORT(S2) InvokeCallback2R(PFNACTION2 callback, S2 s)
+EXPORT(S2) __stdcall InvokeCallback2R(PFNACTION2 callback, S2 s)
{
printf("Native S2: %d, %d, %f\n", s.x, s.y, s.z);
callback(s);
return s;
}
-EXPORT(S3) InvokeCallback3R(PFNACTION3 callback, S3 s)
+EXPORT(S3) __stdcall InvokeCallback3R(PFNACTION3 callback, S3 s)
{
printf("Native S3: %d, %d, %f\n", s.x, s.y, s.z);
callback(s);
return s;
}
-EXPORT(S4) InvokeCallback4R(PFNACTION4 callback, S4 s)
+EXPORT(S4) __stdcall InvokeCallback4R(PFNACTION4 callback, S4 s)
{
printf("Native S4: %d, %f\n", s.x, s.y);
callback(s);
return s;
}
-EXPORT(S5) InvokeCallback5R(PFNACTION5 callback, S5 s)
+EXPORT(S5) __stdcall InvokeCallback5R(PFNACTION5 callback, S5 s)
{
printf("Native S5: %d, %f\n", s.x, s.y);
callback(s);
return s;
}
-EXPORT(S6) InvokeCallback6R(PFNACTION6 callback, S6 s)
+EXPORT(S6) __stdcall InvokeCallback6R(PFNACTION6 callback, S6 s)
{
printf("Native S6: %hd, %hd, %d, %d\n", s.x, s.y, s.z, s.w);
callback(s);
return s;
}
-EXPORT(S7) InvokeCallback7R(PFNACTION7 callback, S7 s)
+EXPORT(S7) __stdcall InvokeCallback7R(PFNACTION7 callback, S7 s)
{
printf("Native S7: %f, %d, %d\n", s.x, s.y, s.z);
callback(s);
return s;
}
-EXPORT(S8) InvokeCallback8R(PFNACTION8 callback, S8 s)
+EXPORT(S8) __stdcall InvokeCallback8R(PFNACTION8 callback, S8 s)
{
printf("Native S8: %f, %d\n", s.x, s.y);
callback(s);
return s;
}
-EXPORT(S9) InvokeCallback9R(PFNACTION9 callback, S9 s)
+EXPORT(S9) __stdcall InvokeCallback9R(PFNACTION9 callback, S9 s)
{
printf("Native S9: %d, %d, %f, %f\n", s.x, s.y, s.z, s.w);
callback(s);
return s;
}
-EXPORT(S10) InvokeCallback10R(PFNACTION10 callback, S10 s)
+EXPORT(S10) __stdcall InvokeCallback10R(PFNACTION10 callback, S10 s)
{
printf("Native S10: %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd\n", s.a, s.b, s.c, s.d, s.e, s.f, s.g, s.h);
callback(s);
return s;
}
-EXPORT(S11) InvokeCallback11R(PFNACTION11 callback, S11 s)
+EXPORT(S11) __stdcall InvokeCallback11R(PFNACTION11 callback, S11 s)
{
printf("Native S11: %hhd, %hhd, %hhd, %hhd, %f\n", s.a, s.b, s.c, s.d, s.e);
callback(s);
return s;
}
-EXPORT(S12) InvokeCallback12R(PFNACTION12 callback, S12 s)
+EXPORT(S12) __stdcall InvokeCallback12R(PFNACTION12 callback, S12 s)
{
printf("Native S12: %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %lld\n", s.a, s.b, s.c, s.d, s.e, s.f, s.g, s.h, s.i);
callback(s);
return s;
}
-EXPORT(S13) InvokeCallback13R(PFNACTION13 callback, S13 s)
+EXPORT(S13) __stdcall InvokeCallback13R(PFNACTION13 callback, S13 s)
{
printf("Native S13: %hhd, %d\n", s.hasValue, s.x);
callback(s);
return s;
}
-EXPORT(S14) InvokeCallback14R(PFNACTION14 callback, S14 s)
+EXPORT(S14) __stdcall InvokeCallback14R(PFNACTION14 callback, S14 s)
{
printf("Native S13: %hhd, %lld\n", s.x, s.y);
callback(s);
return s;
}
-EXPORT(S15) InvokeCallback15R(PFNACTION15 callback, S15 s)
+EXPORT(S15) __stdcall InvokeCallback15R(PFNACTION15 callback, S15 s)
{
printf("Native S15: %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd, %hhd\n", s.a, s.b, s.c, s.d, s.e, s.f, s.g, s.h, s.i);
callback(s);
return s;
}
-EXPORT(S16) InvokeCallback16R(PFNACTION16 callback, S16 s)
+EXPORT(S16) __stdcall InvokeCallback16R(PFNACTION16 callback, S16 s)
{
printf("Native S16: %hhd, %hd\n", s.x, s.y);
callback(s);
return s;
}
-EXPORT(S17) InvokeCallback17R(PFNACTION17 callback, S17 s)
+EXPORT(S17) __stdcall InvokeCallback17R(PFNACTION17 callback, S17 s)
{
printf("Native S17: %f, %f\n", s.x, s.y);
callback(s);
return s;
}
-EXPORT(S18) InvokeCallback18R(PFNACTION18 callback, S18 s)
+EXPORT(S18) __stdcall InvokeCallback18R(PFNACTION18 callback, S18 s)
{
printf("Native S18: %f, %d, %f\n", s.x, s.y, s.z);
callback(s);
return s;
}
-EXPORT(S19) InvokeCallback19R(PFNACTION19 callback, S19 s)
+EXPORT(S19) __stdcall InvokeCallback19R(PFNACTION19 callback, S19 s)
{
printf("Native S19: %d, %f, %d, %f\n", s.x, s.y, s.z, s.w);
callback(s);
return s;
}
-EXPORT(S20) InvokeCallback20R(PFNACTION20 callback, S20 s)
+EXPORT(S20) __stdcall InvokeCallback20R(PFNACTION20 callback, S20 s)
{
#ifdef __clang__
printf("Native S20: %lld, %lld, %lld, %lld\n", s.x, s.y, s.z, s.w);
@@ -461,13 +469,13 @@ EXPORT(S20) InvokeCallback20R(PFNACTION20 callback, S20 s)
return s;
}
-EXPORT(S28) InvokeCallback28R(PFNACTION28 callback, S28 s)
+EXPORT(S28) __stdcall InvokeCallback28R(PFNACTION28 callback, S28 s)
{
printf("Native S28: %p object, %d\n", s.x, s.y);
callback(s);
return s;
}
-EXPORT(S29) InvokeCallback29R(PFNACTION29 callback, S29 s)
+EXPORT(S29) __stdcall InvokeCallback29R(PFNACTION29 callback, S29 s)
{
printf("Native S29: %d, %p object\n", s.x, s.y);
callback(s);