From patchwork Tue Jul 28 15:51:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renlin Li X-Patchwork-Id: 501293 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 E6E681402B6 for ; Wed, 29 Jul 2015 01:51:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=TSuSUyLN; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=nNo5vslMRAPd6x50AtEeFuGZM8rLd3c7a0u6vLH7lc5 AlMaOHVpOBS6wtmqhbKAhrpv5rco3E2B7M0o+epf1kv9wqdQhv5u/xKd0exndGwc 0Pl0tRj1GiypBJvmUBwAARbMro8IIv7cvk2hRvLyEqTA+kVgtYn11Hr5z/UKeEu4 = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=IKCvG342XXUYrGxAszCYxkzShmM=; b=TSuSUyLNurBDXP8Ua KAYVHKxSkDaNdNSWEGM964pu1lHbpckUUwxVQ08ymreoo1H/4uCr2CM84iAww3AV Bp5lEUyaWvgFgfkBzMNQhxHQDqIvF7dfUeB5a5gA7muJRYLoWHNV9vCiPtzi99Vd akN68I2QQe2b+ENKDoNq71GPDY= Received: (qmail 39340 invoked by alias); 28 Jul 2015 15:51:22 -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 39328 invoked by uid 89); 28 Jul 2015 15:51:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Jul 2015 15:51:20 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-31-jjrJLZLSQo2EZ0CcDnAnig-1; Tue, 28 Jul 2015 16:51:15 +0100 Received: from [10.2.207.43] ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 28 Jul 2015 16:51:15 +0100 Message-ID: <55B7A4F3.3000302@arm.com> Date: Tue, 28 Jul 2015 16:51:15 +0100 From: Renlin Li User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Marcus Shawcroft , Ramana Radhakrishnan Subject: [PATCH][AARCH64] Make arm_align_max_stack_pwr.c and arm_align_max_pwr.c compile testcase, instead of execution. X-MC-Unique: jjrJLZLSQo2EZ0CcDnAnig-1 Hi all, This is a simple patch to make arm_align_max_stack_pwr.c and arm_align_max_pwr.c compile test cases, instead of execution tests. In my local machine, those test cases pass. However, they fail on some systems with process memory usage restrictions. Anyway, the required space for those two newly defined macros are too big. By rewriting the test cases, the basic maximum alignment support is checked at compile time. The correct code generation is checked by scanning assembly output. Tested using aarch64-none-linux-gnu and aarch64-none-elf toolchain. They all passes. Okay to commit? gcc/testsuite/ChangeLog: 2015-07-28 Renlin Li * gcc.target/aarch64/arm_align_max_pwr.c: Make it a compile test case, check the assembly. * gcc.target/aarch64/arm_align_max_stack_pwr.c: Likewise. diff --git a/gcc/testsuite/gcc.target/aarch64/arm_align_max_pwr.c b/gcc/testsuite/gcc.target/aarch64/arm_align_max_pwr.c index bbb4c6f..ffa4d22 100644 --- a/gcc/testsuite/gcc.target/aarch64/arm_align_max_pwr.c +++ b/gcc/testsuite/gcc.target/aarch64/arm_align_max_pwr.c @@ -1,15 +1,23 @@ -/* { dg-do run } */ - -#include -#include +/* { dg-do compile } */ +/* { dg-options "-O1" } */ #define align (1ul << __ARM_ALIGN_MAX_PWR) static int x __attribute__ ((aligned (align))); +static int y __attribute__ ((aligned (align))); + +extern void foo (int *x, int *y); +extern int bar (int x, int y); int -main () +dummy () { - assert ((((unsigned long)&x) & (align - 1)) == 0); + int result; - return 0; + foo (&x, &y); + result = bar (x, y); + + return result; } + +/* { dg-final { scan-assembler-times "zero\t4" 2 } } */ +/* { dg-final { scan-assembler "zero\t268435452" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/arm_align_max_stack_pwr.c b/gcc/testsuite/gcc.target/aarch64/arm_align_max_stack_pwr.c index 7a6355b..ea22b80 100644 --- a/gcc/testsuite/gcc.target/aarch64/arm_align_max_stack_pwr.c +++ b/gcc/testsuite/gcc.target/aarch64/arm_align_max_stack_pwr.c @@ -1,15 +1,23 @@ -/* { dg-do run } */ +/* { dg-do compile } */ +/* { dg-options "-O1" } */ #include #include #define align (1ul << __ARM_ALIGN_MAX_STACK_PWR) +extern void foo (int *x); +extern int bar (int x); int -main () +dummy () { int x __attribute__ ((aligned (align))); + int result; - assert ((((unsigned long)&x) & (align - 1)) == 0); - return 0; + foo (&x); + result = bar (x); + + return result; } + +/* { dg-final { scan-assembler "and\tx\[0-9\]+, x\[0-9\]+, -65536" } } */