diff mbox series

[Committed] New test case gcc.target/avr/pr54816.c

Message ID 00c701d9705c$083f5250$18bdf6f0$@nextmovesoftware.com
State New
Headers show
Series [Committed] New test case gcc.target/avr/pr54816.c | expand

Commit Message

Roger Sayle April 16, 2023, 12:07 p.m. UTC
PR target/54816 is now fixed on mainline.  This adds a test case to
check that it doesn't regress in future.  Tested with a cross compiler
to avr-elf.  Committed as obvious.


2023-04-16  Roger Sayle  <roger@nextmovesoftware.com>

gcc/testsuite/ChangeLog
	PR target/54816
	* gcc.target/avr/pr54816.c: New test case.
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/avr/pr54816.c b/gcc/testsuite/gcc.target/avr/pr54816.c
new file mode 100644
index 0000000..56be780
--- /dev/null
+++ b/gcc/testsuite/gcc.target/avr/pr54816.c
@@ -0,0 +1,9 @@ 
+/* { dg-do compile } */
+/* { dg-options "-Os -mmcu=atmega8" } */
+int wmul (char a, char b)
+{
+    return a * (char) (b << 3);
+}
+
+/* { dg-final { scan-assembler-times "lsl" 3 } } */
+/* { dg-final { scan-assembler-times "muls" 1 } } */