public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Stubbs <ams@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Subject: [PATCH v3 08/10] Testsuite: GCN is always PIE.
Date: Wed, 12 Dec 2018 11:53:00 -0000	[thread overview]
Message-ID: <8f72cd8c7d9d4629e0f25c8f55f0a2fdb6b79587.1544611347.git.ams@codesourcery.com> (raw)
In-Reply-To: <cover.1544611347.git.ams@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]


[Already approved by Jeff Law. Included here for completeness.]

The GCN/HSA loader ignores the load address and uses a random location, so we
build all GCN binaries as PIE, by default.

This patch makes the necessary testsuite adjustments to make this work
correctly.

2018-12-12  Andrew Stubbs  <ams@codesourcery.com>

	gcc/testsuite/
	* gcc.dg/graphite/scop-19.c: Check pie_enabled.
	* gcc.dg/pic-1.c: Disable on amdgcn.
	* gcc.dg/pic-2.c: Disable on amdgcn.
	* gcc.dg/pic-3.c: Disable on amdgcn.
	* gcc.dg/pic-4.c: Disable on amdgcn.
	* gcc.dg/pie-3.c: Disable on amdgcn.
	* gcc.dg/pie-4.c: Disable on amdgcn.
	* gcc.dg/uninit-19.c: Check pie_enabled.
	* lib/target-supports.exp (check_effective_target_pie): Add amdgcn.
---
 gcc/testsuite/gcc.dg/graphite/scop-19.c | 4 ++--
 gcc/testsuite/gcc.dg/pic-1.c            | 2 +-
 gcc/testsuite/gcc.dg/pic-2.c            | 1 +
 gcc/testsuite/gcc.dg/pic-3.c            | 2 +-
 gcc/testsuite/gcc.dg/pic-4.c            | 2 +-
 gcc/testsuite/gcc.dg/pie-3.c            | 2 +-
 gcc/testsuite/gcc.dg/pie-4.c            | 2 +-
 gcc/testsuite/lib/target-supports.exp   | 3 ++-
 8 files changed, 10 insertions(+), 8 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0008-Testsuite-GCN-is-always-PIE.patch --]
[-- Type: text/x-patch; name="0008-Testsuite-GCN-is-always-PIE.patch", Size: 3890 bytes --]

diff --git a/gcc/testsuite/gcc.dg/graphite/scop-19.c b/gcc/testsuite/gcc.dg/graphite/scop-19.c
index c89717b..6028132 100644
--- a/gcc/testsuite/gcc.dg/graphite/scop-19.c
+++ b/gcc/testsuite/gcc.dg/graphite/scop-19.c
@@ -31,6 +31,6 @@ d_growable_string_append_buffer (struct d_growable_string *dgs,
   if (need > dgs->alc)
     d_growable_string_resize (dgs, need);
 }
-/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 2 "graphite" { target nonpic } } } */
-/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 1 "graphite" { target { ! nonpic } } } } */
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 2 "graphite" { target { nonpic || pie_enabled } } } } */
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 1 "graphite" { target { ! { nonpic || pie_enabled } } } } } */
 
diff --git a/gcc/testsuite/gcc.dg/pic-1.c b/gcc/testsuite/gcc.dg/pic-1.c
index 82ba43d..4bb332e 100644
--- a/gcc/testsuite/gcc.dg/pic-1.c
+++ b/gcc/testsuite/gcc.dg/pic-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { *-*-darwin* hppa*-*-* } } } } */
+/* { dg-do compile { target { ! { *-*-darwin* hppa*-*-* amdgcn*-*-* } } } } */
 /* { dg-require-effective-target fpic } */
 /* { dg-options "-fpic" } */
 
diff --git a/gcc/testsuite/gcc.dg/pic-2.c b/gcc/testsuite/gcc.dg/pic-2.c
index bccec13..3846ec4 100644
--- a/gcc/testsuite/gcc.dg/pic-2.c
+++ b/gcc/testsuite/gcc.dg/pic-2.c
@@ -2,6 +2,7 @@
 /* { dg-require-effective-target fpic } */
 /* { dg-options "-fPIC" } */
 /* { dg-skip-if "__PIC__ is always 1 for MIPS" { mips*-*-* } } */
+/* { dg-skip-if "__PIE__ is always defined for GCN" { amdgcn*-*-* } } */
 
 #if __PIC__ != 2
 # error __PIC__ is not 2!
diff --git a/gcc/testsuite/gcc.dg/pic-3.c b/gcc/testsuite/gcc.dg/pic-3.c
index c56f06f..1397977 100644
--- a/gcc/testsuite/gcc.dg/pic-3.c
+++ b/gcc/testsuite/gcc.dg/pic-3.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* } } } } */
+/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* amdgcn*-*-* } } } } */
 /* { dg-options "-fno-pic" } */
 
 #ifdef __PIC__
diff --git a/gcc/testsuite/gcc.dg/pic-4.c b/gcc/testsuite/gcc.dg/pic-4.c
index 2afdd99..d6d9dc9 100644
--- a/gcc/testsuite/gcc.dg/pic-4.c
+++ b/gcc/testsuite/gcc.dg/pic-4.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* } } } } */
+/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* amdgcn*-*-* } } } } */
 /* { dg-options "-fno-PIC" } */
 
 #ifdef __PIC__
diff --git a/gcc/testsuite/gcc.dg/pie-3.c b/gcc/testsuite/gcc.dg/pie-3.c
index 5577437..fd4a48d 100644
--- a/gcc/testsuite/gcc.dg/pie-3.c
+++ b/gcc/testsuite/gcc.dg/pie-3.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* } } } } */
+/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* amdgcn*-*-* } } } } */
 /* { dg-options "-fno-pie" } */
 
 #ifdef __PIC__
diff --git a/gcc/testsuite/gcc.dg/pie-4.c b/gcc/testsuite/gcc.dg/pie-4.c
index 4134676..5523602 100644
--- a/gcc/testsuite/gcc.dg/pie-4.c
+++ b/gcc/testsuite/gcc.dg/pie-4.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* } } } } */
+/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* amdgcn*-*-* } } } } */
 /* { dg-options "-fno-PIE" } */
 
 #ifdef __PIC__
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 15e33eb..eb3fbcd 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1176,7 +1176,8 @@ proc check_effective_target_pie { } {
 	 || [istarget *-*-dragonfly*]
 	 || [istarget *-*-freebsd*]
 	 || [istarget *-*-linux*]
-	 || [istarget *-*-gnu*] } {
+	 || [istarget *-*-gnu*]
+	 || [istarget *-*-amdhsa]} {
 	return 1;
     }
     if { [istarget *-*-solaris2.1\[1-9\]*] } {

  parent reply	other threads:[~2018-12-12 11:53 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 11:52 [PATCH v3 00/10] AMD GCN Port v3 Andrew Stubbs
2018-12-12 11:52 ` [PATCH v3 03/10] GCN libgcc Andrew Stubbs
2018-12-12 11:52 ` [PATCH v3 02/10] GCN libgfortran Andrew Stubbs
2018-12-12 11:52 ` [PATCH 01/10] Fix LRA bug Andrew Stubbs
2018-12-13 23:49   ` Jeff Law
2018-12-14 10:04     ` Andrew Stubbs
2018-12-14 11:52       ` Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 05/10] GCN back-end code Andrew Stubbs
2024-01-31 17:12   ` GCN: Remove 'SGPR_OR_VGPR_REGNO_P' definition (was: [PATCH v3 05/10] GCN back-end code) Thomas Schwinge
2024-01-31 17:22     ` GCN: Remove 'SGPR_OR_VGPR_REGNO_P' definition Andrew Stubbs
2024-02-01 13:49   ` GCN: Don't hard-code number of SGPR/VGPR/AVGPR registers (was: [PATCH v3 05/10] GCN back-end code) Thomas Schwinge
2024-02-01 14:45     ` GCN: Don't hard-code number of SGPR/VGPR/AVGPR registers Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 04/10] GCN machine description Andrew Stubbs
2020-04-29  8:30   ` Thomas Schwinge
2024-01-31 17:21   ` GCN: Remove 'FIRST_{SGPR,VGPR,AVGPR}_REG', 'LAST_{SGPR,VGPR,AVGPR}_REG' from machine description (was: [PATCH v3 04/10] GCN machine description) Thomas Schwinge
2024-01-31 17:41     ` GCN: Remove 'FIRST_{SGPR,VGPR,AVGPR}_REG', 'LAST_{SGPR,VGPR,AVGPR}_REG' from machine description Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 07/10] Add dg-require-effective-target exceptions Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 10/10] Port testsuite to GCN Andrew Stubbs
2018-12-17 12:17   ` Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 06/10] GCN back-end config Andrew Stubbs
2020-03-09 15:24   ` [Patch] ./configure.ac – build libgomp by default for amdgcn*-*-* Tobias Burnus
2020-03-09 15:56     ` Jakub Jelinek
2020-04-29  8:23     ` [gcn] Don't default to building target-libstdc++-v3 [PR92713] (was: [PATCH v3 06/10] GCN back-end config) Thomas Schwinge
2018-12-12 11:53 ` Andrew Stubbs [this message]
2018-12-12 11:53 ` [PATCH v3 09/10] Ignore LLVM's blank lines Andrew Stubbs
2018-12-12 12:07   ` Rainer Orth
2018-12-17 12:09     ` Andrew Stubbs
2018-12-13  1:32   ` Segher Boessenkool
2019-01-28 21:35   ` H.J. Lu
2019-01-07 10:48 ` [PATCH v3 00/10] AMD GCN Port v3 Andrew Stubbs
2019-01-07 11:59   ` Richard Biener
2019-01-11 23:20     ` Jeff Law
2019-01-14 13:55       ` Andrew Stubbs
2019-01-17 12:51         ` Andrew Stubbs
2019-01-17 12:55           ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f72cd8c7d9d4629e0f25c8f55f0a2fdb6b79587.1544611347.git.ams@codesourcery.com \
    --to=ams@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).