require et feature pie for PIE tests
authorAlexandre Oliva <oliva@adacore.com>
Wed, 24 Mar 2021 08:44:39 +0000 (05:44 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 24 Mar 2021 08:48:33 +0000 (05:48 -0300)
Both of these tests fail on platforms that reject -fPIC/-fPIE
altogether.

Other tests that perform PIE compilation or linking require the pie
feature, whether for -fpie/-fPIE compilation or for -pie linking.

This patch annotates both tests with the required target feature.

for  gcc/testsuite/ChangeLog

* gcc.target/i386/pr97313.c: Require effective target feature pie.
* g++.target/i386/pr94185.C: Likewise.

gcc/testsuite/g++.target/i386/pr94185.C
gcc/testsuite/gcc.target/i386/pr97313.c

index 2b3f7a1..ed39980 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fPIE -fstack-protector-strong" } */
+/* { dg-require-effective-target pie } */
 
 struct a {
   int b;
index ef93cf1..711766b 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fPIE" } */
+/* { dg-require-effective-target pie } */
 
 typedef struct {
   int unspecified : 1;