From patchwork Thu Dec 14 13:40:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 848545 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-469199-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="bf9GvMDV"; 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 3yyF7b2v4kz9s7f for ; Fri, 15 Dec 2017 00:40: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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=oN+ZBmQMaamSX01/8ZxI0mmiq4LA62S2WZE1f1f3cHFjXMlyGO ITYVNNCLANYtCR2mdstvozwUOwaHKhFtCXRcHyHdEq19RMflXstltKRqHp9Ehc+V x33O3k1iMihRdnk7wREm7YULw6k4x3LYrymp5q45NkwjOq6F+luI4pqa8= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=4LKLQoxWZ2UN59hMPjIZgiouNcY=; b=bf9GvMDVBJ9Ln/T9zvki cv+f+eCmukhC+L64GLwVTC4NrFtCYRAWiJggDsz1nhWi4xyhQdcbUgos/PaB5Nms d5gehiDrJ9yTzTz2zxwzZAX3aCbcb0UogZAV0H3mq3twghQLnLb/fnHi6QgSzi/u QKKUaLsIGNvUrEEtcsms7as= Received: (qmail 71886 invoked by alias); 14 Dec 2017 13:40:32 -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 71876 invoked by uid 89); 14 Dec 2017 13:40:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 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, URIBL_RED autolearn=ham version=3.3.2 spammy=HTo:D*comcast.net 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; Thu, 14 Dec 2017 13:40:26 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1ePTkM-0003In-D1 from Tom_deVries@mentor.com ; Thu, 14 Dec 2017 05:40:22 -0800 Received: from [172.30.72.115] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 14 Dec 2017 13:40:16 +0000 To: GCC Patches , Mike Stump , Rainer Orth From: Tom de Vries Subject: [testsuite] Require effective target weak_undefined for visibility-22.c Message-ID: Date: Thu, 14 Dec 2017 14:40:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, this patch introduces an effective target weak_undefined, and uses it in test-case visibility-22.c. I've tested this on trunk for x86_64, and the test still runs and passes. I've tested this on an internal branch for the gcn target, where it makes the test unsupported (instead of timing out due to random code execution). OK for trunk? Thanks, - Tom Require effective target weak_undefined for visibility-22.c 2017-12-14 Tom de Vries * lib/target-supports.exp (check_effective_target_weak_undefined): New proc. * gcc.dg/visibility-22.c: Require effective target weak_undefined. --- gcc/testsuite/gcc.dg/visibility-22.c | 1 + gcc/testsuite/lib/target-supports.exp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/gcc/testsuite/gcc.dg/visibility-22.c b/gcc/testsuite/gcc.dg/visibility-22.c index 52f59be..49a95ce 100644 --- a/gcc/testsuite/gcc.dg/visibility-22.c +++ b/gcc/testsuite/gcc.dg/visibility-22.c @@ -1,6 +1,7 @@ /* PR target/32219 */ /* { dg-do run } */ /* { dg-require-visibility "" } */ +/* { dg-require-effective-target weak_undefined } */ /* { dg-options "-O2 -fPIC" { target fpic } } */ /* This test requires support for undefined weak symbols. This support is not available on hppa*-*-hpux*. The test is skipped rather than diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 9750b7a..227d8f6 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -328,6 +328,15 @@ proc check_weak_available { } { } } +# return 1 if weak undefined symbols are supported. + +proc check_effective_target_weak_undefined { } { + return [check_runtime weak_undefined { + extern void foo () __attribute__((weak)); + int main(void) { if (foo) return 1; return 0; } + } ""] +} + ############################### # proc check_weak_override_available { } ###############################