This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testsuite] Fix various i386 tests for -march in multilib options


Recall that when testing with multilib options (runtest --target_board
$board/$options) the multilib options come *after* the options
specified in dg-options in the testcase.  Thus tests in general need
to be skipped when the multilib options override something from
dg-options on which the test relies for correctness (as opposed, say,
to simply not testing the bug it was intended to test when the extra
option is there, but still being expected to pass).
gcc.target/arm/mmx-1.c is an example of a test with a series of
conditions to disable it for inappropriate multilib options.

This patch adds appropriate dg-skip-if directives to various
IA32/x86_64 tests that need such disabling for some -march values, and
skips gcc.misc-tests/i386-prefetch.exp altogether when the multilib
flags contain -march.  (This only addresses some particular tests for
which I observed problems in testing with some particular -march
values; others may also be affected by this issue, depending on the
-march value, but certainly some tests using -march are only testing
for ICEs and do not need such conditionals.)  OK to commit?

2009-09-07  Joseph Myers  <joseph@codesourcery.com>

	* gcc.misc-tests/i386-prefetch.exp: Skip tests when multilib flags
	contain -march.
	* gcc.dg/tree-ssa/prefetch-7.c, gcc.target/i386/387-1.c,
	gcc.target/i386/387-5.c, gcc.target/i386/cmov7.c,
	gcc.target/i386/funcspec-1.c, gcc.target/i386/funcspec-8.c,
	gcc.target/i386/gcc-have-sync-compare-and-swap-1.c,
	gcc.target/i386/gcc-have-sync-compare-and-swap-2.c,
	gcc.target/i386/isa-6.c, gcc.target/i386/lea.c,
	gcc.target/i386/pentium4-not-mull.c, gcc.target/i386/sse-5.c,
	gcc.target/i386/ssefn-1.c: Skip when multilib flags contain -march
	options other than that used in dg-options.

Index: gcc.target/i386/ssefn-1.c
===================================================================
--- gcc.target/i386/ssefn-1.c	(revision 151474)
+++ gcc.target/i386/ssefn-1.c	(working copy)
@@ -7,6 +7,7 @@
 /* { dg-final { scan-assembler "mulss" } } */
 /* { dg-final { scan-assembler-not "movsd" } } */
 /* { dg-final { scan-assembler-not "mulsd" } } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
 /* { dg-options "-O2 -march=i386 -msse -mfpmath=sse -fno-inline" } */
 
 static float xs (void)
Index: gcc.target/i386/cmov7.c
===================================================================
--- gcc.target/i386/cmov7.c	(revision 151474)
+++ gcc.target/i386/cmov7.c	(working copy)
@@ -1,6 +1,7 @@
 /* PR middle-end/33187 */
 
 /* { dg-do compile } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=k8" } } */
 /* { dg-options "-O2 -ffast-math -march=k8 -mbranch-cost=5 -mfpmath=387" } */
 /* { dg-final { scan-assembler "fcmov" } } */
 
Index: gcc.target/i386/gcc-have-sync-compare-and-swap-2.c
===================================================================
--- gcc.target/i386/gcc-have-sync-compare-and-swap-2.c	(revision 151474)
+++ gcc.target/i386/gcc-have-sync-compare-and-swap-2.c	(working copy)
@@ -1,5 +1,6 @@
 /* { dg-do preprocess } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i486" } } */
 /* { dg-options "-march=i486" } */
 
 #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
Index: gcc.target/i386/sse-5.c
===================================================================
--- gcc.target/i386/sse-5.c	(revision 151474)
+++ gcc.target/i386/sse-5.c	(working copy)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
 /* { dg-options "-Winline -O2 -march=i386" } */
 
 typedef double v2df __attribute__ ((vector_size (16)));
Index: gcc.target/i386/funcspec-8.c
===================================================================
--- gcc.target/i386/funcspec-8.c	(revision 151474)
+++ gcc.target/i386/funcspec-8.c	(working copy)
@@ -1,6 +1,7 @@
 /* Test whether using target specific options, we can use the x86 builtin
    functions in functions with the appropriate function specific options.  */
 /* { dg-do compile } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=k8" } } */
 /* { dg-options "-O2 -march=k8 -mfpmath=sse" } */
 
 typedef float     __m128  __attribute__ ((__vector_size__ (16), __may_alias__));
Index: gcc.target/i386/lea.c
===================================================================
--- gcc.target/i386/lea.c	(revision 151474)
+++ gcc.target/i386/lea.c	(working copy)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=pentiumpro" } } */
 /* { dg-options "-O2 -march=pentiumpro" } */
 /* { dg-final { scan-assembler "leal" } } */
 typedef struct {
Index: gcc.target/i386/gcc-have-sync-compare-and-swap-1.c
===================================================================
--- gcc.target/i386/gcc-have-sync-compare-and-swap-1.c	(revision 151474)
+++ gcc.target/i386/gcc-have-sync-compare-and-swap-1.c	(working copy)
@@ -1,5 +1,6 @@
 /* { dg-do preprocess } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
 /* { dg-options "-march=i386" } */
 
 #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
Index: gcc.target/i386/387-1.c
===================================================================
--- gcc.target/i386/387-1.c	(revision 151474)
+++ gcc.target/i386/387-1.c	(working copy)
@@ -1,6 +1,7 @@
 /* Verify that -mno-fancy-math-387 works.  */
 /* { dg-do compile } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
 /* { dg-options "-O -ffast-math -mfpmath=387 -mno-fancy-math-387 -march=i386" } */
 /* { dg-final { scan-assembler "call\t(.*)sin" } } */
 /* { dg-final { scan-assembler "call\t(.*)cos" } } */
Index: gcc.target/i386/isa-6.c
===================================================================
--- gcc.target/i386/isa-6.c	(revision 151474)
+++ gcc.target/i386/isa-6.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=amdfam10" } } */
 /* { dg-options "-march=amdfam10 -mno-sse4" } */
 
 extern void abort (void);
Index: gcc.target/i386/funcspec-1.c
===================================================================
--- gcc.target/i386/funcspec-1.c	(revision 151474)
+++ gcc.target/i386/funcspec-1.c	(working copy)
@@ -3,6 +3,7 @@
    for a function that doesn't use attribute((option)).  */
 /* { dg-do compile } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
 /* { dg-options "-O3 -ftree-vectorize -march=i386" } */
 /* { dg-final { scan-assembler "addps\[ \t\]" } } */
 /* { dg-final { scan-assembler "fsubs\[ \t\]" } } */
Index: gcc.target/i386/387-5.c
===================================================================
--- gcc.target/i386/387-5.c	(revision 151474)
+++ gcc.target/i386/387-5.c	(working copy)
@@ -1,6 +1,7 @@
 /* Verify that -mno-fancy-math-387 works.  */
 /* { dg-do compile } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
 /* { dg-options "-O -ffast-math -mfpmath=387 -mno-fancy-math-387 -march=i386" } */
 /* { dg-final { scan-assembler "call\t(.*)atan" } } */
 /* { dg-final { scan-assembler "call\t(.*)log1p" } } */
Index: gcc.target/i386/pentium4-not-mull.c
===================================================================
--- gcc.target/i386/pentium4-not-mull.c	(revision 151474)
+++ gcc.target/i386/pentium4-not-mull.c	(working copy)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=pentium4" } } */
 /* { dg-options "-O2 -march=pentium4" } */
 /* { dg-final { scan-assembler-not "imull" } } */
 
Index: gcc.dg/tree-ssa/prefetch-7.c
===================================================================
--- gcc.dg/tree-ssa/prefetch-7.c	(revision 151474)
+++ gcc.dg/tree-ssa/prefetch-7.c	(working copy)
@@ -1,5 +1,6 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
 /* { dg-require-effective-target ilp32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */
 /* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 --param max-unrolled-insns=1 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
 
 #define K 1000000
Index: gcc.misc-tests/i386-prefetch.exp
===================================================================
--- gcc.misc-tests/i386-prefetch.exp	(revision 151474)
+++ gcc.misc-tests/i386-prefetch.exp	(working copy)
@@ -90,6 +90,13 @@
 dg-init
 torture-init
 
+if { [board_info target exists multilib_flags]
+     && [string match "* -march=*" " [board_info target multilib_flags] "] } {
+    # Multilib flags come after the -march flags we pass and override
+    # them, so skip these tests when such flags are passed.
+    return
+}
+
 set-torture-options $PREFETCH_NONE
 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-none-*.c]] ""
 

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]