Require SHF_GNU_RETAIN support for retain test

Message ID 20210222230658.1220250-1-hjl.tools@gmail.com
State New
Headers show
Series
  • Require SHF_GNU_RETAIN support for retain test
Related show

Commit Message

Marek Polacek via Gcc-patches Feb. 22, 2021, 11:06 p.m.
Since retain attribute requires SHF_GNU_RETAIN, run retain tests only
if SHF_GNU_RETAIN is supported.

	PR testsuite/99173
	* c-c++-common/attr-retain-5.c: Require R_flag_in_section.
	* c-c++-common/attr-retain-6.c: Likewise.
	* c-c++-common/attr-retain-7.c: Likewise.
	* c-c++-common/attr-retain-8.c: Likewise.
	* c-c++-common/attr-retain-9.c: Likewise.
---
 gcc/testsuite/c-c++-common/attr-retain-5.c | 2 +-
 gcc/testsuite/c-c++-common/attr-retain-6.c | 2 +-
 gcc/testsuite/c-c++-common/attr-retain-7.c | 2 +-
 gcc/testsuite/c-c++-common/attr-retain-8.c | 2 +-
 gcc/testsuite/c-c++-common/attr-retain-9.c | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.29.2

Comments

Marek Polacek via Gcc-patches Feb. 22, 2021, 11:09 p.m. | #1
On Mon, Feb 22, 2021 at 03:06:58PM -0800, H.J. Lu via Gcc-patches wrote:
> Since retain attribute requires SHF_GNU_RETAIN, run retain tests only

> if SHF_GNU_RETAIN is supported.

> 

> 	PR testsuite/99173

> 	* c-c++-common/attr-retain-5.c: Require R_flag_in_section.

> 	* c-c++-common/attr-retain-6.c: Likewise.

> 	* c-c++-common/attr-retain-7.c: Likewise.

> 	* c-c++-common/attr-retain-8.c: Likewise.

> 	* c-c++-common/attr-retain-9.c: Likewise.


Ok, thanks.

	Jakub

Patch

diff --git a/gcc/testsuite/c-c++-common/attr-retain-5.c b/gcc/testsuite/c-c++-common/attr-retain-5.c
index ee6e2c4e054..1f3f8bfb5c5 100644
--- a/gcc/testsuite/c-c++-common/attr-retain-5.c
+++ b/gcc/testsuite/c-c++-common/attr-retain-5.c
@@ -1,4 +1,4 @@ 
-/* { dg-do compile } */
+/* { dg-do compile { target R_flag_in_section } } */
 /* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */
 /* { dg-options "-Wall -O2" } */
 
diff --git a/gcc/testsuite/c-c++-common/attr-retain-6.c b/gcc/testsuite/c-c++-common/attr-retain-6.c
index 9aead148ec8..ed6cfae2948 100644
--- a/gcc/testsuite/c-c++-common/attr-retain-6.c
+++ b/gcc/testsuite/c-c++-common/attr-retain-6.c
@@ -1,4 +1,4 @@ 
-/* { dg-do compile } */
+/* { dg-do compile { target R_flag_in_section } } */
 /* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */
 /* { dg-options "-Wall -O2" } */
 
diff --git a/gcc/testsuite/c-c++-common/attr-retain-7.c b/gcc/testsuite/c-c++-common/attr-retain-7.c
index 4c1673583db..c56d18a88e0 100644
--- a/gcc/testsuite/c-c++-common/attr-retain-7.c
+++ b/gcc/testsuite/c-c++-common/attr-retain-7.c
@@ -1,4 +1,4 @@ 
-/* { dg-do compile } */
+/* { dg-do compile { target R_flag_in_section } } */
 /* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */
 /* { dg-options "-Wall -O2" } */
 
diff --git a/gcc/testsuite/c-c++-common/attr-retain-8.c b/gcc/testsuite/c-c++-common/attr-retain-8.c
index 7e067f56274..c1a9b52972e 100644
--- a/gcc/testsuite/c-c++-common/attr-retain-8.c
+++ b/gcc/testsuite/c-c++-common/attr-retain-8.c
@@ -1,4 +1,4 @@ 
-/* { dg-do compile } */
+/* { dg-do compile { target R_flag_in_section } } */
 /* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */
 /* { dg-options "-Wall -O2" } */
 
diff --git a/gcc/testsuite/c-c++-common/attr-retain-9.c b/gcc/testsuite/c-c++-common/attr-retain-9.c
index 81accc0ee91..e6d7c0b43da 100644
--- a/gcc/testsuite/c-c++-common/attr-retain-9.c
+++ b/gcc/testsuite/c-c++-common/attr-retain-9.c
@@ -1,4 +1,4 @@ 
-/* { dg-do compile } */
+/* { dg-do compile { target R_flag_in_section } } */
 /* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */
 /* { dg-options "-Wall -O2" } */