2008-03-04 Anthony Green <green@redhat.com>
Blake Chaffin
hos@tamanegi.org
* testsuite/libffi.call/cls_align_longdouble_split2.c
testsuite/libffi.call/cls_align_longdouble_split.c
testsuite/libffi.call/cls_dbls_struct.c
testsuite/libffi.call/cls_double_va.c
testsuite/libffi.call/cls_longdouble.c
testsuite/libffi.call/cls_longdouble_va.c
testsuite/libffi.call/cls_pointer.c
testsuite/libffi.call/cls_pointer_stack.c
testsuite/libffi.call/err_bad_abi.c
testsuite/libffi.call/err_bad_typedef.c
testsuite/libffi.call/huge_struct.c
testsuite/libffi.call/stret_large2.c
testsuite/libffi.call/stret_large.c
testsuite/libffi.call/stret_medium2.c
testsuite/libffi.call/stret_medium.c: New tests from Apple.
This commit is contained in:
44
libffi/testsuite/libffi.call/err_bad_abi.c
Normal file
44
libffi/testsuite/libffi.call/err_bad_abi.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/* Area: ffi_prep_cif, ffi_prep_closure
|
||||
Purpose: Test error return for bad ABIs.
|
||||
Limitations: none.
|
||||
PR: none.
|
||||
Originator: Blake Chaffin 6/6/2007 */
|
||||
|
||||
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
#include "ffitest.h"
|
||||
|
||||
static void
|
||||
dummy_fn(ffi_cif* cif, void* resp, void** args, void* userdata)
|
||||
{}
|
||||
|
||||
int main (void)
|
||||
{
|
||||
ffi_cif cif;
|
||||
#ifndef USING_MMAP
|
||||
static ffi_closure cl;
|
||||
#endif
|
||||
ffi_closure *pcl;
|
||||
void* args[1];
|
||||
ffi_type* arg_types[1];
|
||||
|
||||
#ifdef USING_MMAP
|
||||
pcl = allocate_mmap (sizeof(ffi_closure));
|
||||
#else
|
||||
pcl = &cl;
|
||||
#endif
|
||||
|
||||
arg_types[0] = NULL;
|
||||
args[0] = NULL;
|
||||
|
||||
CHECK(ffi_prep_cif(&cif, 255, 0, &ffi_type_void,
|
||||
arg_types) == FFI_BAD_ABI);
|
||||
|
||||
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void,
|
||||
arg_types) == FFI_OK);
|
||||
|
||||
cif.abi= 255;
|
||||
|
||||
CHECK(ffi_prep_closure(pcl, &cif, dummy_fn, NULL) == FFI_BAD_ABI);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
Reference in New Issue
Block a user