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] [testsuite, arm] Missing test case for thumb2 pop single


Find a missing test case for
https://gcc.gnu.org/ml/gcc-patches/2015-01/msg00789.html left at the corner.

Merged with the latest trunk. New test case does not fail on
thumb1/thumb2/arm targets.

ChangeLog:

2015-07-24:  Joey Ye  <joey.ye@arm.com>
	* gcc.target/arm/thumb2-pop-single.c: New test.

diff --git a/gcc/testsuite/gcc.target/arm/thumb2-pop-single.c
b/gcc/testsuite/gcc.target/arm/thumb2-pop-single.c
new file mode 100644
index 0000000..f86c633
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/thumb2-pop-single.c
@@ -0,0 +1,14 @@
+/* Verify if thumb2 save/restore lr unnecessarily in case of tail call.  */
+/* Verify if thumb2 generates pop to restore a single register.  */
+/* { dg-do compile { target arm_thumb2 } } */
+/* { dg-options "-Os" } */
+/* { dg-final { scan-assembler-not "push.*lr" } } */
+/* { dg-final { scan-assembler "pop\[\\t \]+\{r\[4-7\]\}" } } */
+extern int
+bar (int, int, int, int);
+
+int
+foo (int a, int b, int c, int d)
+{
+  return bar (b, a, c, d);
+}





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