OSDN Git Service

2008-11-26 Kai Tietz <kai.tietz@onevision.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Nov 2008 10:22:24 +0000 (10:22 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Nov 2008 10:22:24 +0000 (10:22 +0000)
        * gcc.dg/callabi/func-indirect.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142214 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/callabi/func-indirect.c [new file with mode: 0644]

index 08ee43c..1842a47 100644 (file)
@@ -1,3 +1,7 @@
+2008-11-26  Kai Tietz  <kai.tietz@onevision.com>
+
+       * gcc.dg/callabi/func-indirect.c: New.
+
 2008-11-25  Jason Merrill  <jason@redhat.com>
 
        PR c++/28743
diff --git a/gcc/testsuite/gcc.dg/callabi/func-indirect.c b/gcc/testsuite/gcc.dg/callabi/func-indirect.c
new file mode 100644 (file)
index 0000000..d7733bd
--- /dev/null
@@ -0,0 +1,24 @@
+/* Test for cross x86_64<->w64 abi standard calls via variable.
+*/
+/* Origin: Kai Tietz <kai.tietz@onevision.com> */
+/* { dg-do run { target { x86_64-*-* } } } */
+/* { dg-options "-std=gnu99 -ffast-math" } */
+#include "callabi.h"
+
+extern void abort (void);
+
+typedef int (CALLABI_CROSS *func)(void *, char *, char *, short, long long);
+
+int CALLABI_CROSS
+callback(void * ptr, char *string1, char *string2, short number, long long rand)
+{
+    return (rand != 0x1234567890abcdefLL);
+}
+
+int main()
+{
+    volatile func callme = callback;
+    if(callme(0, 0, 0, 0, 0x1234567890abcdefLL))
+     abort();
+}
+