diff mbox series

require et feature pie for PIE tests

Message ID ork0pxavnd.fsf@lxoliva.fsfla.org
State New
Headers show
Series require et feature pie for PIE tests | expand

Commit Message

Alexandre Oliva March 24, 2021, 6:55 a.m. UTC
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.

Regstrapped on x86_64-linux-gnu and cross-tested for x86_64-vx7r2 along
with other patches, mostly for the testsuite.  Ok to install?


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 |    1 +
 gcc/testsuite/gcc.target/i386/pr97313.c |    1 +
 2 files changed, 2 insertions(+)

Comments

Uros Bizjak March 24, 2021, 6:56 a.m. UTC | #1
On Wed, Mar 24, 2021 at 7:55 AM Alexandre Oliva <oliva@adacore.com> wrote:
>
>
> 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.
>
> Regstrapped on x86_64-linux-gnu and cross-tested for x86_64-vx7r2 along
> with other patches, mostly for the testsuite.  Ok to install?
>
>
> for  gcc/testsuite/ChangeLog
>
>         * gcc.target/i386/pr97313.c: Require effective target feature pie.
>         * g++.target/i386/pr94185.C: Likewise.

OK (even obvious).

Thanks,
Uros.

> ---
>  gcc/testsuite/g++.target/i386/pr94185.C |    1 +
>  gcc/testsuite/gcc.target/i386/pr97313.c |    1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/gcc/testsuite/g++.target/i386/pr94185.C b/gcc/testsuite/g++.target/i386/pr94185.C
> index 2b3f7a1d676bd..ed3998010ae39 100644
> --- a/gcc/testsuite/g++.target/i386/pr94185.C
> +++ b/gcc/testsuite/g++.target/i386/pr94185.C
> @@ -1,5 +1,6 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O2 -fPIE -fstack-protector-strong" } */
> +/* { dg-require-effective-target pie } */
>
>  struct a {
>    int b;
> diff --git a/gcc/testsuite/gcc.target/i386/pr97313.c b/gcc/testsuite/gcc.target/i386/pr97313.c
> index ef93cf1cca8f4..711766b413211 100644
> --- a/gcc/testsuite/gcc.target/i386/pr97313.c
> +++ b/gcc/testsuite/gcc.target/i386/pr97313.c
> @@ -1,5 +1,6 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O2 -fPIE" } */
> +/* { dg-require-effective-target pie } */
>
>  typedef struct {
>    int unspecified : 1;
>
> --
> Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
>    Free Software Activist         GNU Toolchain Engineer
>         Vim, Vi, Voltei pro Emacs -- GNUlius Caesar
diff mbox series

Patch

diff --git a/gcc/testsuite/g++.target/i386/pr94185.C b/gcc/testsuite/g++.target/i386/pr94185.C
index 2b3f7a1d676bd..ed3998010ae39 100644
--- a/gcc/testsuite/g++.target/i386/pr94185.C
+++ b/gcc/testsuite/g++.target/i386/pr94185.C
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O2 -fPIE -fstack-protector-strong" } */
+/* { dg-require-effective-target pie } */
 
 struct a {
   int b;
diff --git a/gcc/testsuite/gcc.target/i386/pr97313.c b/gcc/testsuite/gcc.target/i386/pr97313.c
index ef93cf1cca8f4..711766b413211 100644
--- a/gcc/testsuite/gcc.target/i386/pr97313.c
+++ b/gcc/testsuite/gcc.target/i386/pr97313.c
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O2 -fPIE" } */
+/* { dg-require-effective-target pie } */
 
 typedef struct {
   int unspecified : 1;