aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/20050603-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/20050603-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/20050603-1.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20050603-1.c b/gcc/testsuite/gcc.dg/20050603-1.c
new file mode 100644
index 00000000000..041551ba5ae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20050603-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-O2" } */
+#include <locale.h>
+#include <stdlib.h>
+register int *testreg asm ("r29");
+
+int x;
+int y;
+int *ext_func (int *p) { return p; }
+
+void test_reg_save_restore (int*) __attribute__((noinline));
+void
+test_reg_save_restore (int *p)
+{
+ setlocale (LC_ALL, "C");
+ testreg = ext_func(p);
+}
+main() {
+ testreg = &x;
+ test_reg_save_restore (&y);
+ if (testreg != &y)
+ abort ();
+ return 0;
+}