Tested on x86_64-linux, darwin, i686-darwin, pushed to trunk, thanks
Iain

--- 8< ---

Many tests asume default ELF non-pic code, where Darwin defaults to
PIC - for 32b cases we can, however, use -mdynamic-no-pic to approximate
the ELF behaviour - usually sufficient to demonstrate the test purpose.

gcc/testsuite/ChangeLog:

        * gcc.target/i386/pr36502.c: Add -mdynamic-no-pic for Darwin.
        * gcc.target/i386/pr85667-6.c: Likewise.

Signed-off-by: Iain Sandoe <[email protected]>
---
 gcc/testsuite/gcc.target/i386/pr36502.c   | 2 +-
 gcc/testsuite/gcc.target/i386/pr85667-6.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/i386/pr36502.c 
b/gcc/testsuite/gcc.target/i386/pr36502.c
index bc4c7ccf1c8..f745dfc3860 100644
--- a/gcc/testsuite/gcc.target/i386/pr36502.c
+++ b/gcc/testsuite/gcc.target/i386/pr36502.c
@@ -1,6 +1,6 @@
 /* PR target/36502 */
 /* { dg-do compile { target { *-*-darwin* && ilp32 } } } */
-/* { dg-options "-O -fomit-frame-pointer -fno-pic" } */
+/* { dg-options "-O -fomit-frame-pointer -mdynamic-no-pic" } */
 int a;
 void f() {a++;}
 /* { dg-final { scan-assembler-not "esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr85667-6.c 
b/gcc/testsuite/gcc.target/i386/pr85667-6.c
index 06570dd6460..c1058d6ba75 100644
--- a/gcc/testsuite/gcc.target/i386/pr85667-6.c
+++ b/gcc/testsuite/gcc.target/i386/pr85667-6.c
@@ -1,6 +1,7 @@
 /* { dg-do compile { target ia32 } } */
 /* { dg-options "-O2" } */
 /* { dg-additional-options "-fno-PIE" { target ia32 } } */
+/* { dg-additional-options "-mdynamic-no-pic" { target *-*-darwin* } } */
 /* { dg-final { scan-assembler-times "movl\[^\n\r]*, %eax" 1 } } */
 /* { dg-final { scan-assembler-times "flds\[^\n\r]*" 1 } } */
 typedef struct
-- 
2.50.1 (Apple Git-155)

Reply via email to