From patchwork Sun May 26 19:38:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1105602 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-501688-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="kEufEWng"; 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 45Br4n0LWrz9s3Z for ; Mon, 27 May 2019 05:38:26 +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=PVhugy+nlzUpf4jVMeeC xCU1Vey/NuIm7HpSYpezs7ntK9az/D1RFbGUR1eNnKOQWjoDD0i5yljp0L7/sgXe p8yo73jKK/fnBsJ8j0j5Vg7UkYAVglh5pFyvfBpndpg38qzTDTb0/BvSQIeZrSbu hl+UwZ86n2XELR6dYgxyG2I= 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=zpqAiLqT4UJK+yopCMxPaFq486 8=; b=kEufEWngLD1Y/hBpF2FIN3VKY40acwzt/YwRYoGee9FM1Uy6V82s+Kpb9s QSH+2OoM4AtxVvHU9t5ybVzvByhUFJ8fnPNPiQhXGeg3NSGzQfdMpmTegtwpX+h2 vIU1NpVPduVbqujx5okmci13obTq+52YYjqNLLd6Gqbj4NUrM= Received: (qmail 85807 invoked by alias); 26 May 2019 19:38:18 -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 85799 invoked by uid 89); 26 May 2019 19:38:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_COUK autolearn=ham version=3.3.1 spammy=12, 5, U*c, Amend, D*GOTOFF X-HELO: smtp1.wavenetuk.net Received: from smtp.wavenetuk.net (HELO smtp1.wavenetuk.net) (195.26.36.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 26 May 2019 19:38:15 +0000 Received: from euterpe-sie.home (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp1.wavenetuk.net (Postfix) with ESMTPA id 01E52120054F; Sun, 26 May 2019 20:38:11 +0100 (BST) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [PATCH, Darwin, X86, testsuite] Amend scan-asms on three PIE tests. Message-Id: <72BC716E-7A9E-4709-B5F4-A410D1021D02@sandoe.co.uk> Date: Sun, 26 May 2019 20:38:05 +0100 Cc: Uros Bizjak To: GCC Patches Darwin requires PIC code in order to support PIE. Amend the test scan-asms to match this. tested on x86_64-darwin16 and x86_64-linux-gnu (--target_board=unix\{-m32,-m64\}\{,-fpic\}) aplied to mainline, thanks Iain 2019-05-26 Iain Sandoe * gcc.target/i386/pr39013-1.c: Adjust scan-asms for PIE to account for PIC code on Darwin. * gcc.target/i386/pr39013-2.c: Likewise. * gcc.target/i386/pr64317.c: Likewise. diff --git a/gcc/testsuite/gcc.target/i386/pr39013-1.c b/gcc/testsuite/gcc.target/i386/pr39013-1.c index ac22746..78b1702 100644 --- a/gcc/testsuite/gcc.target/i386/pr39013-1.c +++ b/gcc/testsuite/gcc.target/i386/pr39013-1.c @@ -12,5 +12,9 @@ main (void) return foo () + bar (); } -/* { dg-final { scan-assembler "foo@PLT" } } */ -/* { dg-final { scan-assembler "bar@PLT" } } */ +/* { dg-final { scan-assembler "foo@PLT" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "bar@PLT" { target { ! *-*-darwin* } } } } */ + +/* Darwin's dynamic linker does PIE without indirection. */ +/* { dg-final { scan-assembler {call[ \t]_foo} { target *-*-darwin* } } } */ +/* { dg-final { scan-assembler {call[ \t]_bar} { target *-*-darwin* } } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr39013-2.c b/gcc/testsuite/gcc.target/i386/pr39013-2.c index 3040d81..f441290 100644 --- a/gcc/testsuite/gcc.target/i386/pr39013-2.c +++ b/gcc/testsuite/gcc.target/i386/pr39013-2.c @@ -12,5 +12,9 @@ main (void) return foo () + bar (); } -/* { dg-final { scan-assembler "foo@PLT" } } */ -/* { dg-final { scan-assembler "bar@PLT" } } */ +/* { dg-final { scan-assembler "foo@PLT" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "bar@PLT" { target { ! *-*-darwin* } } } } */ + +/* Darwin's dynamic linker does PIE without indirection. */ +/* { dg-final { scan-assembler {call[ \t]_foo} { target *-*-darwin* } } } */ +/* { dg-final { scan-assembler {call[ \t]_bar} { target *-*-darwin* } } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr64317.c b/gcc/testsuite/gcc.target/i386/pr64317.c index 9e13da6..3fbdccd 100644 --- a/gcc/testsuite/gcc.target/i386/pr64317.c +++ b/gcc/testsuite/gcc.target/i386/pr64317.c @@ -2,9 +2,14 @@ /* { dg-require-effective-target ia32 } */ /* { dg-require-effective-target pie } */ /* { dg-options "-O2 -fpie" } */ -/* { dg-final { scan-assembler "addl\[ \\t\]+\[$\]_GLOBAL_OFFSET_TABLE_, %ebx" } } */ -/* { dg-final { scan-assembler "movl\[ \\t\]+c@GOTOFF\[(\]%ebx\[)\]" } } */ -/* { dg-final { scan-assembler-not "movl\[ \\t\]+\[0-9]+\[(\]%esp\[)\], %ebx" } } */ +/* { dg-final { scan-assembler "addl\[ \\t\]+\[$\]_GLOBAL_OFFSET_TABLE_, %ebx" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "movl\[ \\t\]+c@GOTOFF\[(\]%ebx\[)\]" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler-not "movl\[ \\t\]+\[0-9]+\[(\]%esp\[)\], %ebx" { target { ! *-*-darwin* } } } } */ + +/* Check PIC access to c and t1 on Darwin (PIC is default, needed for PIE). */ +/* { dg-final { scan-assembler {_c-L1\$pb\(%} { target *-*-darwin* } } } */ +/* { dg-final { scan-assembler {_t1.[0-9]+-L1\$pb\(%} { target *-*-darwin* } } } */ + long c = 1; int bar();