This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] ARM-specific testcase for PR29877 (TER register variables)


This testcase got omitted by accident from the original PR29877
fix.  OK to apply to both mainline and 4.2?  Tested on 4.2 cross
to arm-none-eabi.

Mark

--


2007-03-18 Mark Shinwell <shinwell@codesourcery.com>


	gcc/testsuite/
	* gcc.target/arm/register-variables.c: New.


Index: gcc/testsuite/gcc.target/arm/register-variables.c =================================================================== --- gcc/testsuite/gcc.target/arm/register-variables.c (revision 0) +++ gcc/testsuite/gcc.target/arm/register-variables.c (revision 0) @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-options "-O" } */ + +#include <stdlib.h> + +void __attribute__((noinline)) +bar(int a, int b) +{ + if (a != 43 || b != 42) + abort(); +} + +int main(void) +{ + register int r0 asm("r0") = 42; + register int r1 asm("r1") = 43; + asm volatile("": "+r" (r0), "+r" (r1)); + bar(r1, r0); + return 0; +} +


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]