summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-20 16:46:37 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-20 16:46:37 +0000
commit349be7d3687a208c4c3fc8f104157d40ccc03bea (patch)
treedbe3ece26cf49880bb2f5bd76db55084b4c49e4c /gcc/testsuite/gcc.target
parent32d19e092c9c707348cc209f1265cf552e719d6a (diff)
downloadgcc-349be7d3687a208c4c3fc8f104157d40ccc03bea.tar.gz
* config/arm/arm.c (arm_expand_prologue): In a nested APCS frame with
arguments to push onto the stack and no varargs, save ip into the last stack slot if r3 isn't available on entry. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206154 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target')
-rw-r--r--gcc/testsuite/gcc.target/arm/nested-apcs.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/nested-apcs.c b/gcc/testsuite/gcc.target/arm/nested-apcs.c
new file mode 100644
index 00000000000..9dac3043e27
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/nested-apcs.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-fno-omit-frame-pointer -mapcs-frame -O" } */
+
+extern void abort (void);
+
+struct x
+{
+ int y;
+ int z;
+};
+
+int __attribute__((noinline)) f (int c, int d, int e, int h, int i)
+{
+ int a;
+ struct x b;
+
+ int __attribute__((noinline)) g (int p, int q, int r, struct x s)
+ {
+ return a + p + q + r + s.y + s.z;
+ }
+
+ a = 5;
+ b.y = h;
+ b.z = i;
+
+ return g(c, d, e, b);
+}
+
+int main(void)
+{
+ if (f (1, 2, 3, 4, 5) != 20)
+ abort();
+ return 0;
+}