From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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:38:00 -0000 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 Content-Type: multipart/mixed; boundary="------------090208070705070608000005" X-SW-Source: 2015-07/txt/msg02389.txt.bz2 This is a multi-part message in MIME format. --------------090208070705070608000005 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 855 Hi all, This is a simple patch to make arm_align_max_stack_pwr.c and=20 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=20 systems with process memory usage restrictions. Anyway, the required=20 space for those two newly defined macros are too big. By rewriting the test cases, the basic maximum alignment support is=20 checked at compile time. The correct code generation is checked by=20 scanning assembly output. Tested using aarch64-none-linux-gnu and aarch64-none-elf toolchain. They=20 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. --------------090208070705070608000005 Content-Type: text/x-patch; name=tmp.diff Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="tmp.diff" Content-length: 1763 diff --git a/gcc/testsuite/gcc.target/aarch64/arm_align_max_pwr.c b/gcc/tes= tsuite/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" } */ =20 #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); =20 int -main () +dummy () { - assert ((((unsigned long)&x) & (align - 1)) =3D=3D 0); + int result; =20 - return 0; + foo (&x, &y); + result =3D 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/g= cc/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" } */ =20 #include #include =20 #define align (1ul << __ARM_ALIGN_MAX_STACK_PWR) +extern void foo (int *x); +extern int bar (int x); =20 int -main () +dummy () { int x __attribute__ ((aligned (align))); + int result; =20 - assert ((((unsigned long)&x) & (align - 1)) =3D=3D 0); - return 0; + foo (&x); + result =3D bar (x); + + return result; } + +/* { dg-final { scan-assembler "and\tx\[0-9\]+, x\[0-9\]+, -65536" } } */ --------------090208070705070608000005--