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
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.
/* { 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()
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);
/* { 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" } } */
/* { 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" } } */
-/* { 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;
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
} "-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 { } {