OSDN Git Service

2009-06-12 Andrew Haley <aph@redhat.com>
[pf3gnuchains/gcc-fork.git] / libffi / testsuite / libffi.call / err_bad_typedef.c
1 /* Area:                ffi_prep_cif
2    Purpose:             Test error return for bad typedefs.
3    Limitations: none.
4    PR:                  none.
5    Originator:  Blake Chaffin 6/6/2007   */
6
7 /* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* i*86-*-linux-* x86_64-*-linux-* sh*-*-* } } */
8 #include "ffitest.h"
9
10 int main (void)
11 {
12         ffi_cif cif;
13         ffi_type* arg_types[1];
14
15         arg_types[0] = NULL;
16
17         ffi_type        badType = ffi_type_void;
18
19         badType.size = 0;
20
21         CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &badType,
22                 arg_types) == FFI_BAD_TYPEDEF);
23
24         exit(0);
25 }