From: renlin Date: Thu, 3 Sep 2015 17:16:33 +0000 (+0000) Subject: [PATCH][AARCH64]Make arm_align_max_stack_pwr.c and arm_align_max_pwr.c compile X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbd31f0c56bfa6fe34819c61090fb8af2e7cb5da;p=thirdparty%2Fgcc.git [PATCH][AARCH64]Make arm_align_max_stack_pwr.c and arm_align_max_pwr.c compile testcase, instead of execution. gcc/testsuite/ 2015-09-03 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227459 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 22a0bc56e898..b1deae4270d0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-09-03 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. + 2015-09-03 Martin Sebor PR c/66516 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 bbb4c6f9d046..ffa4d229922a 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 7a6355b054e4..7f356fe300a0 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,20 @@ -/* { dg-do run } */ - -#include -#include +/* { dg-do compile } */ +/* { dg-options "-O1" } */ #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; + + foo (&x); + result = bar (x); - assert ((((unsigned long)&x) & (align - 1)) == 0); - return 0; + return result; } + +/* { dg-final { scan-assembler "and\tx\[0-9\]+, x\[0-9\]+, -65536" } } */