Pass name cleanups
[official-gcc.git] / libffi / testsuite / libffi.special / unwindtest_ffi_call.cc
blob29739cdb1719b7dd7493909cf6d702d7aaf049bd
1 /* Area: ffi_call, unwind info
2 Purpose: Check if the unwind information is passed correctly.
3 Limitations: none.
4 PR: none.
5 Originator: Andreas Tobler <andreast@gcc.gnu.org> 20061213 */
7 /* { dg-do run } */
8 #include "ffitestcxx.h"
10 static int checking(int a __UNUSED__, short b __UNUSED__,
11 signed char c __UNUSED__)
13 throw 9;
16 int main (void)
18 ffi_cif cif;
19 ffi_type *args[MAX_ARGS];
20 void *values[MAX_ARGS];
21 ffi_arg rint;
23 signed int si;
24 signed short ss;
25 signed char sc;
27 args[0] = &ffi_type_sint;
28 values[0] = &si;
29 args[1] = &ffi_type_sshort;
30 values[1] = &ss;
31 args[2] = &ffi_type_schar;
32 values[2] = &sc;
34 /* Initialize the cif */
35 CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
36 &ffi_type_sint, args) == FFI_OK);
38 si = -6;
39 ss = -12;
40 sc = -1;
42 try
44 ffi_call(&cif, FFI_FN(checking), &rint, values);
45 } catch (int exception_code)
47 CHECK(exception_code == 9);
49 printf("part one OK\n");
50 /* { dg-output "part one OK" } */
52 exit(0);