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 8be2829..656d05b 100644 (file)
@@ -1,5 +1,19 @@
 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.
        * gcc.c-torture/execute/builtins/sprintf-chk.c (s1): Make LOCAL.
        * gcc.c-torture/execute/builtins/stpcpy-chk.c (s1): Likewise.
index 6db7842..5946770 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 d077e3a..7ca0c1b 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 9252d86..a20b213 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 72069fe..d6e378d 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 acfc43d..f7348bd 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 47a6891..bd6dbbe 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 cae79e5..3799896 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 b03c83b..f9c257a 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 0215bf9..4e80b91 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 { } {