From d63a6a20ee96598160efcadd1f4ea82fd0cd93cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Thu, 7 Aug 2014 00:27:25 +0200 Subject: [PATCH] ffi: test functions for bug #1021 Conflicts: vm/ffi_test.c vm/ffi_test.h Note: Let's add tests in basis/compiler/tests/alien.factor for this. --- vm/ffi_test.c | 11 +++++++++++ vm/ffi_test.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/vm/ffi_test.c b/vm/ffi_test.c index 2bef4a5465..e830b50a30 100644 --- a/vm/ffi_test.c +++ b/vm/ffi_test.c @@ -333,3 +333,14 @@ struct ulonglong_pair ffi_test_63() { return ullp; } +void* bug1021_test_1(void* x, int y) { + return (void*)((y * y) + (long)x); +} + +int bug1021_test_2(int x, char *y, void *z) { + return y[0]; +} + +void* bug1021_test_3(int x) { + return (void*)((long)x); +} diff --git a/vm/ffi_test.h b/vm/ffi_test.h index e813ec990d..3c7ff1edba 100644 --- a/vm/ffi_test.h +++ b/vm/ffi_test.h @@ -231,3 +231,6 @@ struct ulonglong_pair { FACTOR_EXPORT struct ulonglong_pair ffi_test_63(); +FACTOR_EXPORT void* bug1021_test_1(void* x, int y); +FACTOR_EXPORT int bug1021_test_2(int x, char* y, void *z); +FACTOR_EXPORT void* bug1021_test_3(int x);