aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/pr40657-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/arm/pr40657-2.c')
-rw-r--r--gcc/testsuite/gcc.target/arm/pr40657-2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/pr40657-2.c b/gcc/testsuite/gcc.target/arm/pr40657-2.c
new file mode 100644
index 00000000000..31d48376730
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr40657-2.c
@@ -0,0 +1,20 @@
+/* { dg-options "-Os -march=armv4t -mthumb" } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-final { scan-assembler-not "sub\[\\t \]*sp,\[\\t \]*sp" } } */
+/* { dg-final { scan-assembler-not "add\[\\t \]*sp,\[\\t \]*sp" } } */
+
+/* Here, we test that if there's a pop of r[4567] in the epilogue,
+ add sp,sp,#12 is removed and replaced by three additional pops
+ of lower-numbered regs. */
+
+extern void bar(int*);
+
+int t1, t2, t3, t4, t5;
+int foo()
+{
+ int i,j,k,x = 0;
+ for (i = 0; i < t1; i++)
+ for (j = 0; j < t2; j++)
+ bar(&x);
+ return x;
+}