diff mbox

[testsuite,arm] Missing test case for thumb2 pop single

Message ID 000001d0c62a$e43885e0$aca991a0$@foss.arm.com
State New
Headers show

Commit Message

Joey Ye July 24, 2015, 4:07 p.m. UTC
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 mbox

Patch

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