diff options
author | David Schleef <ds@hutch.local> | 2008-06-30 17:02:12 -0700 |
---|---|---|
committer | David Schleef <ds@hutch.local> | 2008-06-30 17:02:12 -0700 |
commit | 60d8cb0e9b77509dffcb7b40da48cd931710a130 (patch) | |
tree | 4542db7503eff71e1fab95114cd95073da3d0672 | |
parent | f3cb425bb04f18a7aff87913cfa00e4cb346dfbe (diff) |
[tests] fix stack alignment test on OS/X
-rw-r--r-- | testsuite/stack_align.c | 13 |
1 files 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); |