From patchwork Fri Oct 22 21:35:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: x86 testsuite fixes for -march= multilib testing From: "Joseph S. Myers" X-Patchwork-Id: 68974 Message-Id: To: gcc-patches@gcc.gnu.org Date: Fri, 22 Oct 2010 21:35:09 +0000 (UTC) This patch fixes various x86 testcases for issues running the testsuite with -march= multilib options. (Recall that multilib options passed when running the testsuite come *after* those in dg-options.) * gcc.target/i386/isa-9.c and gcc.target/i386/pr42589.c have -march options in dg-options and should be skipped if other -march options are in the multilib options, similarly to how other tests with this issue are skipped. * gcc.target/i386/sse-19.c tests for a particular assembler instruction with -msse2; this instruction doesn't appear if your -march option (or one configured with --with-arch, presumably) enables SSSE3. Fixed by adding an explicit -march option (I chose -march=x86-64) and skipping for other -march values. * gcc.dg/march-generic.c (which is an x86-specific test despite not being in gcc.target) tests for an error for -march=generic which does not appear if another, valid -march option follows. In this case, arguably there *should* be an error. But since the test gcc.dg/march.c (testing for a -march=foo error) is already skipped for -march in multilib options, I think it is reasonable to skip march-generic.c as well. If any of my options changes result in such errors being given sooner, so they apply even for overridden -march options, then at that point those skips can be removed. OK to commit? 2010-10-22 Joseph Myers * gcc.dg/march-generic.c: Skip for -march in multilib options. * gcc.target/i386/isa-9.c: Skip for -march other than -march=amdfam10 in multilib options. * gcc.target/i386/pr42589.c: Skip for -march other than -march=i486 in multilib options. * gcc.target/i386/sse-19.c: Add -march=x86-64 option and skip for other -march in multilib options. Index: gcc/testsuite/gcc.target/i386/sse-19.c =================================================================== --- gcc/testsuite/gcc.target/i386/sse-19.c (revision 165855) +++ gcc/testsuite/gcc.target/i386/sse-19.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -msse2" } */ +/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=x86-64" } } */ +/* { dg-options "-O3 -march=x86-64 -msse2" } */ /* { dg-final { scan-assembler "punpcklbw" } } */ extern void abort(); #include Index: gcc/testsuite/gcc.target/i386/isa-9.c =================================================================== --- gcc/testsuite/gcc.target/i386/isa-9.c (revision 165855) +++ gcc/testsuite/gcc.target/i386/isa-9.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-fma4" } */ extern void abort (void); Index: gcc/testsuite/gcc.target/i386/pr42589.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr42589.c (revision 165855) +++ gcc/testsuite/gcc.target/i386/pr42589.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target ilp32 } */ +/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i486" } } */ /* { dg-options "-O2 -march=i486" } */ void Index: gcc/testsuite/gcc.dg/march-generic.c =================================================================== --- gcc/testsuite/gcc.dg/march-generic.c (revision 165855) +++ gcc/testsuite/gcc.dg/march-generic.c (working copy) @@ -1,4 +1,5 @@ /* { dg-do compile { target i?86-*-* } } */ +/* { dg-skip-if "" { *-*-* } { "-march=*" } { "" } } */ /* { dg-options "-march=generic" } */ /* { dg-error "generic CPU can be used only for -mtune" "" { target *-*-* } 0 } */ /* { dg-bogus "march" "" { target *-*-* } 0 } */