summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c
blob: 0c0cbb271cad9107d6252bb6295a4edb29fa7f09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Test for cross x86_64<->w64 abi standard calls via variable.
*/
/* Origin: Kai Tietz <kai.tietz@onevision.com> */
/* { dg-do run } */
/* { 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();
    return 0;
}