Hello, This change is a proposal to add
/* { dg-require-effective-target fpic } */ to a few tests in g++.dg that use -fpic or -fPIC but don't currently query the target support. This corresponds to what most other fpic tests do (typically, unless this is implied by some other test such as "target os is Linux") and helps the vxWorks ports at least, as -fpic is not supported in one of the two major modes of such port (kernel vs RTP). Ok to commit ? Thanks in advance! Best Regards, Olivier 2020-11-02 Olivier Hainque <hain...@adacore.com> testsuite/ * g++.dg/pr57878.C: Add dg-require-effective-target fpic. * g++.dg/pr65032.C: Likewise. * g++.dg/pr84279.C: Likewise. * g++.dg/inherit/thunk8.C: Likewise. * g++.dg/inherit/opt/pr64411.C: Likewise.
diff --git a/gcc/testsuite/g++.dg/inherit/thunk8.C b/gcc/testsuite/g++.dg/inherit/thunk8.C index ef645356898d..ecb9cbf37fee 100644 --- a/gcc/testsuite/g++.dg/inherit/thunk8.C +++ b/gcc/testsuite/g++.dg/inherit/thunk8.C @@ -4,6 +4,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-mthumb -fPIC" } */ struct A { diff --git a/gcc/testsuite/g++.dg/opt/pr64411.C b/gcc/testsuite/g++.dg/opt/pr64411.C index 122b9eec414e..6ecc0a89de27 100644 --- a/gcc/testsuite/g++.dg/opt/pr64411.C +++ b/gcc/testsuite/g++.dg/opt/pr64411.C @@ -1,5 +1,6 @@ // PR target/64411 // { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } +// { dg-require-effective-target fpic } // { dg-options "-Os -mcmodel=medium -fPIC -fschedule-insns -fselective-scheduling" } typedef __SIZE_TYPE__ size_t; diff --git a/gcc/testsuite/g++.dg/pr57878.C b/gcc/testsuite/g++.dg/pr57878.C index 5df2b7c9ef4e..ee9142b484bb 100644 --- a/gcc/testsuite/g++.dg/pr57878.C +++ b/gcc/testsuite/g++.dg/pr57878.C @@ -1,5 +1,6 @@ /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ // { dg-require-effective-target c++11 } +// { dg-require-effective-target fpic } /* { dg-options "-O2 -fno-omit-frame-pointer -fPIC" } */ typedef int int32; diff --git a/gcc/testsuite/g++.dg/pr65032.C b/gcc/testsuite/g++.dg/pr65032.C index d6b6768d25a6..6e348f83a8e0 100644 --- a/gcc/testsuite/g++.dg/pr65032.C +++ b/gcc/testsuite/g++.dg/pr65032.C @@ -1,4 +1,5 @@ // { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-require-effective-target fpic } // { dg-options "-Os -std=c++11 -fPIC -fstack-protector-strong -fomit-frame-pointer" } #pragma GCC visibility push(hidden) diff --git a/gcc/testsuite/g++.dg/pr84279.C b/gcc/testsuite/g++.dg/pr84279.C index a88d3fb84703..b2b5b8eabab1 100644 --- a/gcc/testsuite/g++.dg/pr84279.C +++ b/gcc/testsuite/g++.dg/pr84279.C @@ -1,6 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-require-effective-target fpic } */ /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ /* { dg-options "-O3 -mcpu=power8 -g -fPIC -fvisibility=hidden -fstack-protector-strong" } */ -- 2.17.1