From 60d8cb0e9b77509dffcb7b40da48cd931710a130 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 30 Jun 2008 17:02:12 -0700 Subject: [tests] fix stack alignment test on OS/X --- testsuite/stack_align.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/testsuite/stack_align.c b/testsuite/stack_align.c index b2c1a69..9772332 100644 --- a/testsuite/stack_align.c +++ b/testsuite/stack_align.c @@ -238,14 +238,14 @@ void realign(int align) #ifdef HAVE_GCC_ASM #ifdef HAVE_I386 __asm__ __volatile__ ( - " sub %%ebx, %%esp\n" + " sub %%edi, %%esp\n" #ifdef HAVE_SYMBOL_UNDERSCORE " call _check_class_with_alignment\n" #else " call check_class_with_alignment\n" #endif - " add %%ebx, %%esp\n" - :: "b" (align) + " add %%edi, %%esp\n" + :: "D" (align) ); #endif #ifdef HAVE_AMD64 @@ -333,6 +333,13 @@ int main (int argc, char *argv[]) oil_init (); +#ifdef __APPLE__ + /* the dynamic loader on MacOS/X crashes if someone unaligns the stack, so it's + unlikely that any code gets away with doing it. Our test code doesn't get + away with it either, so we'll just bail out. */ + return 0; +#endif + n = oil_class_get_n_classes (); for (i = 0; i < n; i++) { OilFunctionClass *klass = oil_class_get_by_index(i); -- cgit v1.2.3