From: Kai Tietz Date: Wed, 26 Nov 2008 10:22:24 +0000 (+0000) Subject: func-indirect.c: New. X-Git-Tag: releases/gcc-4.4.0~1482 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89d926785d4e8a8f28318d6d3ea90d634d983e55;p=thirdparty%2Fgcc.git func-indirect.c: New. 2008-11-26 Kai Tietz * gcc.dg/callabi/func-indirect.c: New. From-SVN: r142214 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 08ee43c77e38..1842a473d441 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 000000000000..d7733bd9d728 --- /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(); +} +