From 89d926785d4e8a8f28318d6d3ea90d634d983e55 Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Wed, 26 Nov 2008 10:22:24 +0000 Subject: [PATCH] func-indirect.c: New. 2008-11-26 Kai Tietz * gcc.dg/callabi/func-indirect.c: New. From-SVN: r142214 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/callabi/func-indirect.c | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/callabi/func-indirect.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 08ee43c..1842a47 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-11-26 Kai Tietz + + * gcc.dg/callabi/func-indirect.c: New. + 2008-11-25 Jason Merrill 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 index 0000000..d7733bd --- /dev/null +++ b/gcc/testsuite/gcc.dg/callabi/func-indirect.c @@ -0,0 +1,24 @@ +/* Test for cross x86_64<->w64 abi standard calls via variable. +*/ +/* Origin: Kai Tietz */ +/* { 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(); +} + -- 2.7.4