From patchwork Fri Nov 16 16:28:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 999066 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-490303-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="x9tQuizT"; 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 42xNy33GwLz9sBN for ; Sat, 17 Nov 2018 03:30:35 +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=o7uIWYw2VaxagiX/B/ZWgeW1WimZD mkC8TfMmS5g/TzPJS2LPa9tawCwmI/7wUeWcKRj9ND8Go2/D92zuRf5rdK8pY/3D hnkM7s8y0F/1gZuOShGpFjSEMSEOYAX4OTUngRn27pj9ovL410K81pRVQoxxCYZT whXq9d/Lmt3qGg= 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=1OPbGG6QEqjdk/z7NtuVbJDO7Ac=; b=x9t QuizTlvZtmKiX944XQOroFF9EiHV26Z/CS3U8ZSkt23FyeMymSPTJpmDk10qwiu3 r/PB8ALhayr2xENwmeLtOLsdk8+WC9m72YMDBdSrtvCS1ZsW7dNYm2IOpL681/Xy xy8hv01834deonHcS4TePH1Ve5o3UQXTsYF0iknU= Received: (qmail 54135 invoked by alias); 16 Nov 2018 16:28:55 -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 54048 invoked by uid 89); 16 Nov 2018 16:28:54 -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=noisy 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:50 +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 1gNgzB-0001Ij-9X from Andrew_Stubbs@mentor.com for gcc-patches@gcc.gnu.org; Fri, 16 Nov 2018 08:28:49 -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:45 +0000 From: Andrew Stubbs To: Subject: [PATCH 09/10] Ignore LLVM's blank lines. Date: Fri, 16 Nov 2018 16:28:22 +0000 Message-ID: In-Reply-To: References: MIME-Version: 1.0 [Already approved by Jeff Law. Included here for completeness.] The GCN toolchain must use the LLVM assembler and linker because there's no binutils port. The LLVM tools do not have the same diagnostic style as binutils, so the "blank line(s) in output" tests are inappropriate (and very noisy). The LLVM tools also have different command line options, so it's not possible to autodetect object formats in the same way. This patch addresses both issues. 2018-11-16 Andrew Stubbs gcc/testsuite/ * lib/file-format.exp (gcc_target_object_format): Handle AMD GCN. * lib/gcc-dg.exp (gcc-dg-prune): Ignore blank lines from the LLVM linker. * lib/target-supports.exp (check_effective_target_llvm_binutils): New. --- gcc/testsuite/lib/file-format.exp | 3 +++ gcc/testsuite/lib/gcc-dg.exp | 2 +- gcc/testsuite/lib/target-supports.exp | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/lib/file-format.exp b/gcc/testsuite/lib/file-format.exp index 5c47246..c595fe2 100644 --- a/gcc/testsuite/lib/file-format.exp +++ b/gcc/testsuite/lib/file-format.exp @@ -41,6 +41,9 @@ proc gcc_target_object_format { } { } elseif { [istarget *-*-aix*] } { # AIX doesn't necessarily have objdump, so hand-code it. set gcc_target_object_format_saved coff + } elseif { [istarget *-*-amdhsa*] } { + # AMD GCN uses LLVM objdump which is not CLI-compatible + set gcc_target_object_format_saved elf } else { set objdump_name [find_binutils_prog objdump] set open_file [open objfmtst.c w] diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 305dd3c..a5d505d 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -363,7 +363,7 @@ proc gcc-dg-prune { system text } { # Complain about blank lines in the output (PR other/69006) global allow_blank_lines - if { !$allow_blank_lines } { + if { !$allow_blank_lines && ![check_effective_target_llvm_binutils]} { set num_blank_lines [llength [regexp -all -inline "\n\n" $text]] if { $num_blank_lines } { global testname_with_flags diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 2894401..f15e679 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8702,6 +8702,14 @@ proc check_effective_target_offload_hsa { } { } "-foffload=hsa" ] } +# Return 1 if the compiler has been configured with hsa offloading. + +proc check_effective_target_offload_gcn { } { + return [check_no_compiler_messages offload_gcn assembly { + int main () {return 0;} + } "-foffload=amdgcn-unknown-amdhsa" ] +} + # Return 1 if the target support -fprofile-update=atomic proc check_effective_target_profile_update_atomic {} { return [check_no_compiler_messages profile_update_atomic assembly { @@ -8992,9 +9000,16 @@ proc check_effective_target_cet { } { } "-O2" ] } + # Return 1 if target supports floating point "infinite" proc check_effective_target_inf { } { return [check_no_compiler_messages supports_inf assembly { const double pinf = __builtin_inf (); }] } + +# Return 1 if this target uses an LLVM assembler and/or linker +proc check_effective_target_llvm_binutils { } { + return [expr { [istarget amdgcn*-*-*] + || [check_effective_target_offload_gcn] } ] +}