OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libffi/] [testsuite/] [libffi.call/] [err_bad_abi.c] - Blame information for rev 773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 732 jeremybenn
/* Area:                ffi_prep_cif, ffi_prep_closure
2
   Purpose:             Test error return for bad ABIs.
3
   Limitations: none.
4
   PR:                  none.
5
   Originator:  Blake Chaffin 6/6/2007   */
6
 
7
/* { dg-do run { xfail *-*-* } } */
8
#include "ffitest.h"
9
 
10
static void
11
dummy_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
12
         void** args __UNUSED__, void* userdata __UNUSED__)
13
{}
14
 
15
int main (void)
16
{
17
        ffi_cif cif;
18
        void *code;
19
        ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
20
        ffi_type* arg_types[1];
21
 
22
        arg_types[0] = NULL;
23
 
24
        CHECK(ffi_prep_cif(&cif, 255, 0, &ffi_type_void,
25
                arg_types) == FFI_BAD_ABI);
26
 
27
        CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void,
28
                arg_types) == FFI_OK);
29
 
30
        cif.abi= 255;
31
 
32
        CHECK(ffi_prep_closure_loc(pcl, &cif, dummy_fn, NULL, code) == FFI_BAD_ABI);
33
 
34
        exit(0);
35
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.