diff options
Diffstat (limited to 'libffi/testsuite/libffi.call/cls_align_double.c')
-rw-r--r-- | libffi/testsuite/libffi.call/cls_align_double.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/libffi/testsuite/libffi.call/cls_align_double.c b/libffi/testsuite/libffi.call/cls_align_double.c index 5ba230154a4..22b94d5a09d 100644 --- a/libffi/testsuite/libffi.call/cls_align_double.c +++ b/libffi/testsuite/libffi.call/cls_align_double.c @@ -45,21 +45,13 @@ cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, int main (void) { ffi_cif cif; -#ifndef USING_MMAP - static ffi_closure cl; -#endif - ffi_closure *pcl; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; -#ifdef USING_MMAP - pcl = allocate_mmap (sizeof(ffi_closure)); -#else - pcl = &cl; -#endif - cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; @@ -90,9 +82,9 @@ int main (void) printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ - CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); - res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ |