[committed] Add fpic requirement to tests that use PIC options

Hans-Peter Nilsson hp@bitrange.com
Fri Mar 16 01:38:00 GMT 2007


On Mon, 12 Mar 2007, Richard Sandiford wrote:

> This patch makes some PIC tests say that they require an fpic target.
> Tested on i586-wrs-vxworks (which can handle PIC for RTP multilibs
> but not for kernel multilibs).  Applied as obvious.

I think the gcc.dg/20020426-2.c part was wrong.  It already
passed on non-fpic targets that were not x86 (using "-O2"
there); you should have added the fpic to the target list
instead.

> Index: gcc/testsuite/gcc.dg/20020426-2.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/20020426-2.c	(revision 122834)
> +++ gcc/testsuite/gcc.dg/20020426-2.c	(working copy)
> @@ -3,6 +3,7 @@
>  /* { dg-do run } */
>  /* { dg-options "-O2" } */
>  /* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
> +/* { dg-require-effective-target fpic } */

No "+".  It should have been:
! /* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 && fpic } } } */

> Index: gcc/testsuite/gcc.target/i386/20011119-1.c
> ===================================================================
> --- gcc/testsuite/gcc.target/i386/20011119-1.c	(revision 122834)
> +++ gcc/testsuite/gcc.target/i386/20011119-1.c	(working copy)
> @@ -1,6 +1,7 @@
>  /* Test for reload failing to eliminate from argp to sp.  */
>  /* { dg-do run { target i?86-*-* x86_64-*-* } } */
>  /* { dg-require-effective-target ilp32 } */
> +/* { dg-require-effective-target fpic } */
>  /* { dg-skip-if "" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
>  /* { dg-skip-if "PIC default" { "*-*-darwin*" } { "*" } { "" } } */
>  /* { dg-options "-O2 -fomit-frame-pointer" } */

Likewise here and in many of the other tests, but that's more of
a nit as it doesn't change what's tested where.  I guess you
missed that that you don't have to use
dg-require-effective-target, right?

brgds, H-P



More information about the Gcc-patches mailing list