From patchwork Wed Aug 15 13:20:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 957913 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-483701-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="iEMUfZbH"; 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 41r97c5vDDz9sCP for ; Wed, 15 Aug 2018 23:20:27 +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 :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; q=dns; s=default; b=M8oVJumw4kSoCZA8zu5c IcmeP3e8rxmVLHuDd1uOib9me099GLHaVWVc8Iw8XRNXRMZ2Slsqn4qFAplnnOwX AqllYTC2mpdwdlURzd/KaZZitZn85PcsfiEklx/hwCIl78Exemoi9jgcuN1nDm6K qFXlTKvOhz6rKMWKPnEdawo= 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 :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; s=default; bh=NcGC/yY3vZgzcwRrSU6P2jVpdC A=; b=iEMUfZbHM0BMl4fbZZN+WvIuq8CHT0nSL5t48nq3insIw2rvWtoQ2jmIiK P2Hg7BuPceJ6XrPF+x9rBaat3WXARyX5AqsTu7PbYXGcJ3zhO9u39rmemiW0k7Mv w8jebzGelsxo6uBkX/fNeyzBGwsevl/U/igVhG8fepLFjgbUI= Received: (qmail 2602 invoked by alias); 15 Aug 2018 13:20:20 -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 2581 invoked by uid 89); 15 Aug 2018 13:20:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_COUK, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:ESMTPA X-HELO: smtp2.wavenetuk.net Received: from lisa.wavenetuk.net (HELO smtp2.wavenetuk.net) (195.26.37.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Aug 2018 13:20:16 +0000 Received: from euterpe-sie.home (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp2.wavenetuk.net (Postfix) with ESMTPA id E6A036000DD; Wed, 15 Aug 2018 14:20:13 +0100 (BST) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [PATCH, testsuite] Fix PR78544 for Darwin. Message-Id: Date: Wed, 15 Aug 2018 14:20:10 +0100 Cc: Mike Stump To: GCC Patches Hi, The fails on Darwin are because the section naming convention is different. The patch adds Darwin-specific section attributes and a corresponding target-specific scan-assembler clause. OK for trunk? affected branches (7, 8)? thanks Iain 2018-08-15 Iain Sandoe gcc/testsuite: PR testsuite/78544 * gcc.dg/tree-prof/section-attr-1.c: Add Darwin-specific section attributes and matching. * gcc.dg/tree-prof/section-attr-2.c: Likewise. * gcc.dg/tree-prof/section-attr-3.c: Likewise. --- gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c | 5 +++++ gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c | 5 +++++ gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c b/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c index ee6662ea6e..1f99b3128c 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c @@ -13,7 +13,11 @@ const char *buf_cold; void foo (int path); +#ifdef __APPLE__ +__attribute__ ((section ("__TEXT,__text"))) +#else __attribute__((section(".text"))) +#endif int main (int argc, char *argv[]) { @@ -43,3 +47,4 @@ foo (int path) } /* { dg-final-use { scan-assembler "\.section\[\t \]*\.text\.unlikely\[\\n\\r\]+\[\t \]*\.size\[\t \]*foo\.cold\.0" { target *-*-linux* *-*-gnu* } } } */ +/* { dg-final-use { scan-assembler "\.section\[\t \]*__TEXT,__text_cold\.\*\[\\n\\r\]+_foo\.cold\.0" { target *-*-darwin* } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c b/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c index 898a395cd7..9bdc63a1b0 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c +++ b/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c @@ -28,7 +28,11 @@ main (int argc, char *argv[]) void NOINLINE foo (int path) { +#ifdef __APPLE__ + static int i __attribute__ ((section ("__DATA,__data"))); +#else static int i __attribute__((section(".data"))); +#endif if (path) { for (i = 0; i < SIZE; i++) @@ -42,3 +46,4 @@ foo (int path) } /* { dg-final-use { scan-assembler "\.section\[\t \]*\.text\.unlikely\[\\n\\r\]+\[\t \]*\.size\[\t \]*foo\.cold\.0" { target *-*-linux* *-*-gnu* } } } */ +/* { dg-final-use { scan-assembler "\.section\[\t \]*__TEXT,__text_cold\.\*\[\\n\\r\]+_foo\.cold\.0:" { target *-*-darwin* } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c b/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c index 36829dcb7a..29eee4587d 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c +++ b/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c @@ -9,7 +9,11 @@ #define NOINLINE __attribute__((noinline)) __attribute__ ((noclone)) const char *sarr[SIZE]; +#ifdef __APPLE__ +const char *buf_hot __attribute__ ((section ("__DATA,__data"))); +#else const char *buf_hot __attribute__ ((section (".data"))); +#endif const char *buf_cold; void foo (int path); @@ -43,3 +47,4 @@ foo (int path) } /* { dg-final-use { scan-assembler "\.section\[\t \]*\.text\.unlikely\[\\n\\r\]+\[\t \]*\.size\[\t \]*foo\.cold\.0" { target *-*-linux* *-*-gnu* } } } */ +/* { dg-final-use { scan-assembler "\.section\[\t \]*__TEXT,__text_cold\.\*\[\\n\\r\]+_foo\.cold\.0:" { target *-*-darwin* } } } */