From patchwork Thu Sep 6 11:12:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 966918 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-485296-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="Q3vUNv50"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.b="BPKD99Gr"; 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 425dJh2PbXz9s3x for ; Thu, 6 Sep 2018 21:15:00 +1000 (AEST) 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=poORtbhmVlDDCheWMH95KIGuiEeFtrw4wismZdqEE3BIb1NZQ9Pm3 CodgA5VQd6tUNLsjQRajGsz6FiNQGqz/BhqpgABy051GMqkmmGp3qjGDlJrI0Umz Vn9gBslAy6YLvomqet83qD1qzXjZgaIXyaklQobh4uDveuDMco6d9A= 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=IJ4slcj2n1WjnuejOgqGVD/neGw=; b=Q3vUNv50/hgVcDkHrjfp vb/e8ozEgfhWm1toB1E43FSUD1a23mJTWAosNtuKRx6yehNEtB8bbiiLJYH6Ppfx xMkoJo5ShtFpI49z0xCTSkJ+EngBBKw/TUfLqoD0+0zuKpvUy06vcdqMfNSqp/Qu +MtbDzGo9O4qxfEeVzsDHd0= Received: (qmail 108716 invoked by alias); 6 Sep 2018 11:13:11 -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 108459 invoked by uid 89); 6 Sep 2018 11:13:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.2 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=HX-Get-Message-Sender-Via:sk:authent 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; Thu, 06 Sep 2018 11:13:06 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxsDd-0002wF-I3 for gcc-patches@gcc.gnu.org; Thu, 06 Sep 2018 07:13:04 -0400 Received: from server28.superhosting.bg ([217.174.156.11]:48479) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fxsDd-0002sZ-8W for gcc-patches@gcc.gnu.org; Thu, 06 Sep 2018 07:13:01 -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=eqH8vuMY6AfBLbV+IXf88XRDQSWkyBmCg3eGbl7PDf8=; b=BPKD99GrS5KvL73JeP+y1M3jNN HYGc5aT8X4V9zSWxHgmIkzOw5gpHJO3ZYZgGI1eCjudjYDTrajrFkJ/aBVttZzJ/R5v6kpLkTtw+4 RTa6RLm4T9If3FEFQa3XZLExUKzPlfBwdetj0LODyiHWXiPZZHs6dVVCwiuV4Qv19QLQtOu2PW2lp O4H7siF5gMt7H9l8fMzHrmUtR851lRM5ffceoVU8DzAo8h66Limr8HCIKRmpXTqjMK7p2udaXTG0l d5BqGtqK+fRWAtdoFJUDYOvCPjZzyqUSJUTP0I9FoRihYRLnsseIw9OI0P+vKgoqXnvCpnBCnpOVz xANJ1g6g==; Received: from [95.87.234.74] (port=49506 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1fxsDW-0001sy-BJ; Thu, 06 Sep 2018 14:12:56 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Cc: Dimitar Dimitrov Subject: [PATCH v4 05/10] testsuite: Add check for unsupported TI ABI PRU features to testsuite Date: Thu, 6 Sep 2018 14:12:12 +0300 Message-Id: <20180906111217.24365-6-dimitar@dinux.eu> In-Reply-To: <20180906111217.24365-1-dimitar@dinux.eu> References: <20180906111217.24365-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-08-29 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 7ef9de59dc2..8f70232914b 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 7d4ea35babb..08c011317b4 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2619,6 +2619,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 "" }