x86 testsuite fixes for -march= multilib testing

Richard Guenther richard.guenther@gmail.com
Sat Oct 23 13:17:00 GMT 2010


On Fri, Oct 22, 2010 at 11:35 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> 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?

Ok.

Thanks,
Richard.

> 2010-10-22  Joseph Myers  <joseph@codesourcery.com>
>
>        * 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 <emmintrin.h>
> 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 } */
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
>



More information about the Gcc-patches mailing list