cris: testsuite/gcc.target/cris/biap-mul.c: New test.

Message ID 20210222170409.C3E41203BE@pchp3.se.axis.com
State New
Headers show
Series
  • cris: testsuite/gcc.target/cris/biap-mul.c: New test.
Related show

Commit Message

Needed coverage for that *addi_mul pattern.  Committed.

gcc/testsuite:
	* gcc.target/cris/biap-mul.c: New test.
---
 gcc/testsuite/gcc.target/cris/biap-mul.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/cris/biap-mul.c

-- 
2.11.0

Patch

diff --git a/gcc/testsuite/gcc.target/cris/biap-mul.c b/gcc/testsuite/gcc.target/cris/biap-mul.c
new file mode 100644
index 000000000000..e0054632b239
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/biap-mul.c
@@ -0,0 +1,15 @@ 
+/* Make sure ADDI is used for trivial multiplications too.  */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "\taddi" 2 } } */
+/* { dg-final { scan-assembler-not "\tlsl|\tmul|\tmove|\tadd\[^i\]" } } */
+
+int xyzzy (int r10)
+{
+  return r10 * 5;
+}
+
+int plugh (int r10)
+{
+  return r10 * 3;
+}