]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
target-supports.exp (check_effective_target_nonpic): New procedure.
authorRichard Sandiford <richard@codesourcery.com>
Wed, 21 Mar 2007 09:11:25 +0000 (09:11 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 21 Mar 2007 09:11:25 +0000 (09:11 +0000)
gcc/testsuite/
* lib/target-supports.exp (check_effective_target_nonpic): New
procedure.
* gcc.target/i386/20020616-1.c: Use an alternative to %ebx
when compiling PIC.
* gcc.target/i386/asm-4.c: Require nonpic.
* gcc.target/i386/cmov1.c: Likewise.
* gcc.target/i386/mul.c: Likewise.
* gcc.target/i386/pr21291.c: Require nonpic or ! ilp32.
* gcc.target/i386/ssetype-1.c: Require nonpic.
* gcc.target/i386/ssetype-3.c: Likewise.
* gcc.target/i386/ssetype-5.c: Likewise.

From-SVN: r123107

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/20020616-1.c
gcc/testsuite/gcc.target/i386/asm-4.c
gcc/testsuite/gcc.target/i386/cmov1.c
gcc/testsuite/gcc.target/i386/mul.c
gcc/testsuite/gcc.target/i386/pr21291.c
gcc/testsuite/gcc.target/i386/ssetype-1.c
gcc/testsuite/gcc.target/i386/ssetype-3.c
gcc/testsuite/gcc.target/i386/ssetype-5.c
gcc/testsuite/lib/target-supports.exp

index 8be2829883a52bcdf0246ec503d05026de88ad4f..656d05bd5ec45bcaeaa26ef93f9243db816df91d 100644 (file)
@@ -1,3 +1,17 @@
+2007-03-21  Richard Sandiford  <richard@codesourcery.com>
+
+       * lib/target-supports.exp (check_effective_target_nonpic): New
+       procedure.
+       * gcc.target/i386/20020616-1.c: Use an alternative to %ebx
+       when compiling PIC.
+       * gcc.target/i386/asm-4.c: Require nonpic.
+       * gcc.target/i386/cmov1.c: Likewise.
+       * gcc.target/i386/mul.c: Likewise.
+       * gcc.target/i386/pr21291.c: Require nonpic or ! ilp32.
+       * gcc.target/i386/ssetype-1.c: Require nonpic.
+       * gcc.target/i386/ssetype-3.c: Likewise.
+       * gcc.target/i386/ssetype-5.c: Likewise.
+
 2007-03-21  Richard Sandiford  <richard@codesourcery.com>
 
        * gcc.c-torture/execute/builtins/chk.h (LOCAL): Define.
index 6db7842559622b9aa16f0e7c6b11eb1445580bc4..594677031bad23547f6ffaf3bf4fdb0189e7434c 100644 (file)
@@ -2,7 +2,13 @@
 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
 /* { dg-options "-O2" } */
 
+#if !__PIC__
 register int k asm("%ebx");
+#elif __amd64
+register int k asm("%r12");
+#else
+register int k asm("%esi");
+#endif
 
 void __attribute__((noinline))
 foo()
index d077e3a9871306bc278bb4d94e85530b3e9e8c34..7ca0c1b3c9498ec72bd5eaa3b75181b9e445e66a 100644 (file)
@@ -2,6 +2,8 @@
    taken in C code, don't use alternate calling convention for local
    functions on IA-32.  */
 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* The asm in this test uses an absolute address.  */
+/* { dg-require-effective-target nonpic } */
 /* { dg-options "-O2" } */
 
 extern void abort (void);
index 9252d868f9645c89094c52d89e695124277cdd25..a20b21340ec345a55765438d92d3e6e93e2546c9 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* This test checks for absolute memory operands.  */
+/* { dg-require-effective-target nonpic } */
 /* { dg-options "-O2 -march=k8" } */
 /* { dg-final { scan-assembler "sar\[^\\n\]*magic_namea" } } */
 /* { dg-final { scan-assembler "sar\[^\\n\]*magic_nameb" } } */
index 72069fe2cf813575f067aa5fed0a57b65429dab6..d6e378d44dc47c6c2a3f027420d2ba6bdab71403 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* This test checks for absolute memory operands.  */
+/* { dg-require-effective-target nonpic } */
 /* { dg-options "-O2 -march=k8" } */
 /* { dg-final { scan-assembler "and\[^\\n\]*magic" } } */
 
index acfc43df67f94b0f1e3e8ed0516af85929dae3ee..f7348bdf6e19761ba98650257e97348415866401 100644 (file)
@@ -1,4 +1,9 @@
-/* { dg-do compile } */
+/* The asm has 2 "r" in/out operands, 1 earlyclobber "r" output, 1 "r"
+   input and 2 fixed "r" clobbers (eax and edx), so there are a total of
+   6 registers that must not conflict.  Add to that the PIC register,
+   the frame pointer, and the stack pointer, and we've run out of
+   registers on 32-bit targets.  */
+/* { dg-do compile { target { { ! ilp32 } || nonpic } } } */
 /* { dg-options "-O" } */
 
 typedef unsigned long bngdigit;
index 47a68918d8ce0192efd516ff30b8352e29d2783f..bd6dbbe9f0f3e4fe1855414d167e2726a46daeb1 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* This test checks for absolute memory operands.  */
+/* { dg-require-effective-target nonpic } */
 /* { dg-options "-O2 -msse2 -march=k8" } */
 /* { dg-final { scan-assembler "andpd\[^\\n\]*magic" } } */
 /* { dg-final { scan-assembler "andnpd\[^\\n\]*magic" } } */
index cae79e5520292e50554ae35b841a405034f48dad..3799896c8a4a17a2a73eb04a4aa0c539a21750f4 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* This test checks for absolute memory operands.  */
+/* { dg-require-effective-target nonpic } */
 /* { dg-options "-O2 -msse2 -march=k8" } */
 /* { dg-final { scan-assembler "andps\[^\\n\]*magic" } } */
 /* { dg-final { scan-assembler "andnps\[^\\n\]*magic" } } */
index b03c83bab84e249066c27ab3769c0b0129ed2a2a..f9c257aa89845cf654c024a1dd8905700a22ba0d 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* This test checks for absolute memory operands.  */
+/* { dg-require-effective-target nonpic } */
 /* { dg-options "-O2 -msse2 -march=k8" } */
 /* { dg-final { scan-assembler "pand\[^\\n\]*magic" } } */
 /* { dg-final { scan-assembler "pandn\[^\\n\]*magic" } } */
index 0215bf9ff6cd92afece0a3e115c539e2aa43860d..4e80b91abe5cb74c145bacc38041d1250abc49e8 100644 (file)
@@ -527,6 +527,16 @@ proc check_effective_target_mpaired_single { } {
     } "-mpaired-single"]
 }
 
+# Return 1 if the current multilib does not generate PIC by default.
+
+proc check_effective_target_nonpic { } {
+    return [check_no_compiler_messages nonpic assembly {
+       #if __PIC__
+       #error FOO
+       #endif
+    }]
+}
+
 # Return 1 if the target does not use a status wrapper.
 
 proc check_effective_target_unwrapped { } {