diff options
Diffstat (limited to 'libffi/testsuite/libffi.call/cls_9byte2.c')
-rw-r--r-- | libffi/testsuite/libffi.call/cls_9byte2.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/libffi/testsuite/libffi.call/cls_9byte2.c b/libffi/testsuite/libffi.call/cls_9byte2.c index 8cafc8af6c8..5c0ba0d4b8d 100644 --- a/libffi/testsuite/libffi.call/cls_9byte2.c +++ b/libffi/testsuite/libffi.call/cls_9byte2.c @@ -43,21 +43,13 @@ static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp, 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[3]; ffi_type* cls_struct_fields[3]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[3]; -#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; @@ -88,9 +80,9 @@ int main (void) /* { dg-output "\nres: 8 17" } */ - CHECK(ffi_prep_closure(pcl, &cif, cls_struct_9byte_gn, NULL) == FFI_OK); + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK); - res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(pcl))(h_dbl, j_dbl); + res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(code))(h_dbl, j_dbl); /* { dg-output "\n7 8 1 9: 8 17" } */ printf("res: %g %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ |