summaryrefslogtreecommitdiff
path: root/libffi/testsuite/libffi.call/cls_pointer.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-16 13:09:38 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-16 13:09:38 +0000
commit22642efda7e6534076c91bd0d9ee4a244ea44c4a (patch)
treef379042d103278bfa7fe040ddace8f7ca34aa4cd /libffi/testsuite/libffi.call/cls_pointer.c
parent5be59a5529f8877a7933cf0131353a0d54383b96 (diff)
downloadgcc-22642efda7e6534076c91bd0d9ee4a244ea44c4a.tar.gz
2009-06-16 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r148523 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@148527 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi/testsuite/libffi.call/cls_pointer.c')
-rw-r--r--libffi/testsuite/libffi.call/cls_pointer.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/libffi/testsuite/libffi.call/cls_pointer.c b/libffi/testsuite/libffi.call/cls_pointer.c
index ffc1f6a3544..34e4209640b 100644
--- a/libffi/testsuite/libffi.call/cls_pointer.c
+++ b/libffi/testsuite/libffi.call/cls_pointer.c
@@ -32,20 +32,12 @@ cls_pointer_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[3];
// ffi_type cls_pointer_type;
ffi_type* arg_types[3];
-#ifdef USING_MMAP
- pcl = allocate_mmap(sizeof(ffi_closure));
-#else
- pcl = &cl;
-#endif
-
/* cls_pointer_type.size = sizeof(void*);
cls_pointer_type.alignment = 0;
cls_pointer_type.type = FFI_TYPE_POINTER;
@@ -71,9 +63,9 @@ int main (void)
printf("res: 0x%08x\n", (unsigned int) res);
/* { dg-output "\nres: 0x9be02467" } */
- CHECK(ffi_prep_closure(pcl, &cif, cls_pointer_gn, NULL) == FFI_OK);
+ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK);
- res = (ffi_arg)((void*(*)(void*, void*))(pcl))(arg1, arg2);
+ res = (ffi_arg)((void*(*)(void*, void*))(code))(arg1, arg2);
/* { dg-output "\n0x12345678 0x89abcdef: 0x9be02467" } */
printf("res: 0x%08x\n", (unsigned int) res);
/* { dg-output "\nres: 0x9be02467" } */