This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] [testsuite, arm] Missing test case for thumb2 pop single
- From: "Joey Ye" <joey dot ye at foss dot arm dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: "Joey Ye" <Joey dot Ye at arm dot com>
- Date: Fri, 24 Jul 2015 17:07:49 +0100
- Subject: [patch] [testsuite, arm] Missing test case for thumb2 pop single
- Authentication-results: sourceware.org; auth=none
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);
+}