From patchwork Tue Oct 16 19:35:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 985003 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-487686-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Zalm5ZDn"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.b="FEizX/4j"; 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 42ZQbN1Lgcz9s9h for ; Wed, 17 Oct 2018 06:38:39 +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:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=Uj8Smxlg95LCy9jYfK2WkZtN47O8GbVFna7v9LYsDrT37j/kGfHlG u4wd7gzB5uDVs005Y0Tsncz31twkgyAsZdcpTSYZbynK1pCo8VtoDmpKjz+6jL28 wOfVQyO5bDmU3tDNE988CO1cp1byRpNRDw+VCjrKyIOxAm/KsbnVEc= 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:cc:subject:date:message-id:in-reply-to:references; s= default; bh=9sPk4WUDMF3ov5SP6hCOhs3BcVA=; b=Zalm5ZDnIg/pOHk5nPJ+ irg92XuzXNWZPR5ei4kqtUp4WxImu4ZqGAcUtTUPhLsyamGSduFVaz3YyDg36QzF MpWHs2GK6Rdix9ANC7OG/DFVESNNZSoIhBkjkGfIRWuASBAKktkvTQ32K95cnsIj 69eqOtG8EQtid8cVDn4rbcw= Received: (qmail 95762 invoked by alias); 16 Oct 2018 19:37:01 -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 95060 invoked by uid 89); 16 Oct 2018 19:36:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=445, Hx-languages-length:3233, HX-Get-Message-Sender-Via:sk:authent, UD:eu X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Oct 2018 19:36:52 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCV96-00053S-3a for gcc-patches@gcc.gnu.org; Tue, 16 Oct 2018 15:36:51 -0400 Received: from server28.superhosting.bg ([217.174.156.11]:42336) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gCV95-0004zC-LV for gcc-patches@gcc.gnu.org; Tue, 16 Oct 2018 15:36:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1cmc/rPvT0tHmu+8g5AfU/VN2ciSI9GMrVNSEdDL0qY=; b=FEizX/4jXtfZs5RJxn275pgzwz 6wEXkPb6iKMAHIh0FjpspYQLoT22o7oKyoaUEfoYFGkXVFo8Tm3iE5b4aJSS1VSsb+Y7r6LKsj+jK 0SkNma8Tr5tmAtS928sXwEgTdtc0219+Y1ZlzTu51jY7AGT/4Wg24NN6vAYB4weUDk/mVPFthTZXV jMbDp0R4C3wAhqaj7R4c4XQz2edkyl4PgCiZeavbytZzZNgqsP7gKlEl+VK8lOVMunCBe4cNexRN2 YPNB9QenVwamRJRB/6mhrFnQlKjMyA6VZtAW6a0MTuIp+qBdye4fE7NNiClp3c21ksxh2kyQm6yMc FC/h+lVA==; Received: from [95.87.234.74] (port=55218 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1gCV90-0007tG-2M; Tue, 16 Oct 2018 22:36:44 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Cc: Dimitar Dimitrov Subject: [PATCH v5 05/10] testsuite: Add check for unsupported TI ABI PRU features to testsuite Date: Tue, 16 Oct 2018 22:35:50 +0300 Message-Id: <20181016193555.25143-6-dimitar@dinux.eu> In-Reply-To: <20181016193555.25143-1-dimitar@dinux.eu> References: <20181016193555.25143-1-dimitar@dinux.eu> X-OutGoing-Spam-Status: No, score=-1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.174.156.11 X-IsSubscribed: yes Not all C language features are supported when -mabi=ti option is used for PRU target. gcc/testsuite/ChangeLog: 2018-10-08 Dimitar Dimitrov * lib/gcc-dg.exp: Filter unsupported features in PRU's TI ABI mode. * lib/target-utils.exp: Ditto. * lib/target-supports.exp (check_effective_target_function_pointers, check_effective_target_large_return_values): New. Signed-off-by: Dimitar Dimitrov --- gcc/testsuite/lib/gcc-dg.exp | 11 +++++++++++ gcc/testsuite/lib/target-supports.exp | 26 ++++++++++++++++++++++++++ gcc/testsuite/lib/target-utils.exp | 8 ++++++++ 3 files changed, 45 insertions(+) diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 59c10016014..3287184c0bb 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -407,6 +407,17 @@ proc gcc-dg-prune { system text } { return "::unsupported::memory full" } + if { [string match "*error: function pointers not supported*" $text] + && ![check_effective_target_function_pointers] } { + # The format here is important. See dg.exp. + return "::unsupported::funcptr" + } + if { [string match "*error: large return values not supported*" $text] + && ![check_effective_target_large_return_values] } { + # The format here is important. See dg.exp. + return "::unsupported::large return values" + } + return $text } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 13e32377885..6e475df0922 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2602,6 +2602,32 @@ proc check_effective_target_ptr32plus { } { }] } +# Return 1 if target supports function pointers, 0 otherwise. + +proc check_effective_target_function_pointers { } { + if { [istarget pru-*-*] } { + return [check_no_compiler_messages func_ptr_avail assembly { + #ifdef __PRU_EABI_GNU__ + #error unsupported + #endif + }] + } + return 1 +} + +# Return 1 if target supports arbitrarily large return values, 0 otherwise. + +proc check_effective_target_large_return_values { } { + if { [istarget pru-*-*] } { + return [check_no_compiler_messages func_ptr_avail assembly { + #ifdef __PRU_EABI_GNU__ + #error unsupported + #endif + }] + } + return 1 +} + # Return 1 if we support 32-bit or larger array and structure sizes # using default options, 0 otherwise. Avoid false positive on # targets with 20 or 24 bit address spaces. diff --git a/gcc/testsuite/lib/target-utils.exp b/gcc/testsuite/lib/target-utils.exp index 732a1827a02..f636be2cb01 100644 --- a/gcc/testsuite/lib/target-utils.exp +++ b/gcc/testsuite/lib/target-utils.exp @@ -44,5 +44,13 @@ proc ${tool}_check_unsupported_p { output } { [string match "*exceeds local store*" $output] } { return "memory full" } + if { [string match "*error: function pointers not supported*" $output] + && ![check_effective_target_function_pointers] } { + return "function pointers not supported" + } + if { [string match "*error: large return values not supported*" $output] + && ![check_effective_target_large_return_values] } { + return "large return values not supported" + } return "" }