diff options
author | Josh Triplett <josh@joshtriplett.org> | 2014-03-16 03:25:53 -0700 |
---|---|---|
committer | Josh Triplett <josh@joshtriplett.org> | 2014-03-16 05:05:06 -0700 |
commit | e1911f78df113ca58738b66089a070d4cf747de7 (patch) | |
tree | f27856d28c9a252629c8a57387aecefd4e919bc8 /testsuite | |
parent | 9531d05f64c2a674e0197158ffad68d69f177bd0 (diff) | |
download | libffi-e1911f78df113ca58738b66089a070d4cf747de7.tar.gz |
Add support for stdcall, thiscall, and fastcall on non-Windows x86-32
Linux supports the stdcall calling convention, either via functions
explicitly declared with the stdcall attribute, or via code compiled
with -mrtd which effectively makes stdcall the default.
This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
non-Windows x86-32 platforms, as non-default calling conventions.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/libffi.call/closure_stdcall.c | 5 | ||||
-rw-r--r-- | testsuite/libffi.call/closure_thiscall.c | 5 | ||||
-rw-r--r-- | testsuite/libffi.call/fastthis1_win32.c | 2 | ||||
-rw-r--r-- | testsuite/libffi.call/fastthis2_win32.c | 2 | ||||
-rw-r--r-- | testsuite/libffi.call/fastthis3_win32.c | 2 | ||||
-rw-r--r-- | testsuite/libffi.call/many2_win32.c | 2 | ||||
-rw-r--r-- | testsuite/libffi.call/many_win32.c | 2 | ||||
-rw-r--r-- | testsuite/libffi.call/strlen2_win32.c | 2 | ||||
-rw-r--r-- | testsuite/libffi.call/strlen_win32.c | 2 | ||||
-rw-r--r-- | testsuite/libffi.call/struct1_win32.c | 2 | ||||
-rw-r--r-- | testsuite/libffi.call/struct2_win32.c | 2 |
11 files changed, 17 insertions, 11 deletions
diff --git a/testsuite/libffi.call/closure_stdcall.c b/testsuite/libffi.call/closure_stdcall.c index 2cc2e03..871d576 100644 --- a/testsuite/libffi.call/closure_stdcall.c +++ b/testsuite/libffi.call/closure_stdcall.c @@ -4,7 +4,7 @@ PR: none. Originator: <twalljava@dev.java.net> */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" static void @@ -23,6 +23,9 @@ closure_test_stdcall(ffi_cif* cif __UNUSED__, void* resp, void** args, } +#ifndef _MSC_VER +#define __stdcall __attribute__((stdcall)) +#endif typedef int (__stdcall *closure_test_type0)(int, int, int, int); int main (void) diff --git a/testsuite/libffi.call/closure_thiscall.c b/testsuite/libffi.call/closure_thiscall.c index 33ce8b6..12a0a63 100644 --- a/testsuite/libffi.call/closure_thiscall.c +++ b/testsuite/libffi.call/closure_thiscall.c @@ -4,7 +4,7 @@ PR: none. Originator: <ktietz@redhat.com> */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" static void @@ -23,6 +23,9 @@ closure_test_thiscall(ffi_cif* cif __UNUSED__, void* resp, void** args, } +#ifndef _MSC_VER +#define __thiscall __attribute__((thiscall)) +#endif typedef int (__thiscall *closure_test_type0)(int, int, int, int); int main (void) diff --git a/testsuite/libffi.call/fastthis1_win32.c b/testsuite/libffi.call/fastthis1_win32.c index cbc4724..2bac3b2 100644 --- a/testsuite/libffi.call/fastthis1_win32.c +++ b/testsuite/libffi.call/fastthis1_win32.c @@ -4,7 +4,7 @@ PR: none. Originator: From the original ffitest.c */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" diff --git a/testsuite/libffi.call/fastthis2_win32.c b/testsuite/libffi.call/fastthis2_win32.c index 7bdd0e1..e78018c 100644 --- a/testsuite/libffi.call/fastthis2_win32.c +++ b/testsuite/libffi.call/fastthis2_win32.c @@ -4,7 +4,7 @@ PR: none. Originator: From the original ffitest.c */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" diff --git a/testsuite/libffi.call/fastthis3_win32.c b/testsuite/libffi.call/fastthis3_win32.c index b5d606d..c3af801 100644 --- a/testsuite/libffi.call/fastthis3_win32.c +++ b/testsuite/libffi.call/fastthis3_win32.c @@ -4,7 +4,7 @@ PR: none. Originator: From the original ffitest.c */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" diff --git a/testsuite/libffi.call/many2_win32.c b/testsuite/libffi.call/many2_win32.c index 4adbe4d..de6f9bb 100644 --- a/testsuite/libffi.call/many2_win32.c +++ b/testsuite/libffi.call/many2_win32.c @@ -4,7 +4,7 @@ PR: none. Originator: From the original ffitest.c */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" #include <float.h> diff --git a/testsuite/libffi.call/many_win32.c b/testsuite/libffi.call/many_win32.c index d9038f4..e696c93 100644 --- a/testsuite/libffi.call/many_win32.c +++ b/testsuite/libffi.call/many_win32.c @@ -4,7 +4,7 @@ PR: none. Originator: From the original ffitest.c */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" #include <float.h> diff --git a/testsuite/libffi.call/strlen2_win32.c b/testsuite/libffi.call/strlen2_win32.c index 0d81061..465b6c3 100644 --- a/testsuite/libffi.call/strlen2_win32.c +++ b/testsuite/libffi.call/strlen2_win32.c @@ -4,7 +4,7 @@ PR: none. Originator: From the original ffitest.c */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" diff --git a/testsuite/libffi.call/strlen_win32.c b/testsuite/libffi.call/strlen_win32.c index 6fbcc87..2a14b96 100644 --- a/testsuite/libffi.call/strlen_win32.c +++ b/testsuite/libffi.call/strlen_win32.c @@ -4,7 +4,7 @@ PR: none. Originator: From the original ffitest.c */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" diff --git a/testsuite/libffi.call/struct1_win32.c b/testsuite/libffi.call/struct1_win32.c index b756f5a..6decf02 100644 --- a/testsuite/libffi.call/struct1_win32.c +++ b/testsuite/libffi.call/struct1_win32.c @@ -4,7 +4,7 @@ PR: none. Originator: From the original ffitest.c */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" typedef struct diff --git a/testsuite/libffi.call/struct2_win32.c b/testsuite/libffi.call/struct2_win32.c index 5d02285..17a4519 100644 --- a/testsuite/libffi.call/struct2_win32.c +++ b/testsuite/libffi.call/struct2_win32.c @@ -4,7 +4,7 @@ PR: none. Originator: From the original ffitest.c */ -/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +/* { dg-do run { target i?86-*-* } } */ #include "ffitest.h" typedef struct |