From patchwork Fri Nov 16 16:28:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 999064 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-490301-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tGZJvlZM"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42xNxQ0Txlz9sBN for ; Sat, 17 Nov 2018 03:30:01 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=qU+byFoT49WaLRvj3qDEfh6j4TrPz tM/bsNb78jQ0qgXca3Q1a/HWw/8AiZQkb/dATbpBss42mbyWhXOJ1++j1zqfUFkg ZbA2fD+MnYBYLmFxH4AKMoAsvJoaOhjSb6GvhqfMRLDHjFcVVfaekyN/GAo2I2c0 c2VnTXpOJt+upM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=eqlixAQFLh0pbyqvLLfQ15tVk7E=; b=tGZ JvlZM/nUjWSTJGY3yioFM7rdhZUjvpm9+uApE9/irD9DbqPTzEySp7fPze+PS69B cBPywVhqq3i1l1mSHiP+F7i1kh2hXr8nFD2nUzO0JXYjsMjUj5Ew/MqliBRCEljd gQOumHMtvltl6z/IlQIFCtOyU/aeSvaNgriyTWWA= Received: (qmail 53979 invoked by alias); 16 Nov 2018 16:28:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 53882 invoked by uid 89); 16 Nov 2018 16:28:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 16:28:48 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-03.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gNgz8-0001HR-Iy from Andrew_Stubbs@mentor.com for gcc-patches@gcc.gnu.org; Fri, 16 Nov 2018 08:28:46 -0800 Received: from build6-trusty-cs.sje.mentorg.com (137.202.0.90) by SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 16 Nov 2018 16:28:42 +0000 From: Andrew Stubbs To: Subject: [PATCH 08/10] Testsuite: GCN is always PIE. Date: Fri, 16 Nov 2018 16:28:21 +0000 Message-ID: In-Reply-To: References: MIME-Version: 1.0 [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-11-16 Andrew Stubbs 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(-) 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 00b8138..2894401 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1168,7 +1168,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\]*] } {