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

Mark Shinwell shinwell@codesourcery.com
Sun Mar 18 22:37:00 GMT 2007


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;
+}
+



More information about the Gcc-patches mailing list