From 7da35c0f68cd2f53a7124aee3b5c71e70655c231 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Mon, 16 Oct 2006 20:07:46 +0000 Subject: [PATCH] asm-4.c: Fix inline asm for darwin x86_64. 2006-10-16 Eric Christopher * gcc.target/i386/asm-4.c: Fix inline asm for darwin x86_64. From-SVN: r117795 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/asm-4.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 31144a8ce6e..560c025f76c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-10-16 Eric Christopher + + * gcc.target/i386/asm-4.c: Fix inline asm for darwin + x86_64. + 2006-10-16 Mark Mitchell PR c++/28211 diff --git a/gcc/testsuite/gcc.target/i386/asm-4.c b/gcc/testsuite/gcc.target/i386/asm-4.c index c1324388dae..d077e3a9871 100644 --- a/gcc/testsuite/gcc.target/i386/asm-4.c +++ b/gcc/testsuite/gcc.target/i386/asm-4.c @@ -25,7 +25,13 @@ int (*fn) (int, int, int, int); void baz (void) { + /* Darwin loads 64-bit regions above the 4GB boundary so + we need to use this instead. */ +#if defined (__LP64__) && defined (__MACH__) + __asm ("leaq foo(%%rip), %0" : "=r" (fn)); +#else __asm ("movl $foo, %k0" : "=r" (fn)); +#endif if (fn (2, 3, 4, 5) != 14) abort (); }