[13/31] VAX: Add a test for the SImode `ffs' operation

Message ID alpine.LFD.2.21.2011200249380.656242@eddie.linux-mips.org
State New
Headers show
Series
  • VAX: Bring the port up to date (yes, MODE_CC conversion is included)
Related show

Commit Message

Maciej W. Rozycki Nov. 20, 2020, 3:35 a.m.
gcc/testsuite/
	* gcc.target/vax/ffssi.c: New test.
---
 gcc/testsuite/gcc.target/vax/ffssi.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/vax/ffssi.c

-- 
2.11.0

Comments

Jonathan Wakely via Gcc-patches Nov. 20, 2020, 11:22 p.m. | #1
On 11/19/20 8:35 PM, Maciej W. Rozycki wrote:
> 	gcc/testsuite/

> 	* gcc.target/vax/ffssi.c: New test.

OK. Same comment about prereqs.

jeff

Patch

diff --git a/gcc/testsuite/gcc.target/vax/ffssi.c b/gcc/testsuite/gcc.target/vax/ffssi.c
new file mode 100644
index 00000000000..3e7a3c2b301
--- /dev/null
+++ b/gcc/testsuite/gcc.target/vax/ffssi.c
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+
+int
+ffssi (int x)
+{
+  return __builtin_ffs (x);
+}
+
+/* Expect assembly like:
+
+	ffs $0,$32,%r1,%r0
+	jneq .L2
+	mnegl $1,%r0
+.L2:
+	incl %r0
+
+ */
+
+/* { dg-final { scan-assembler "\tffs \\\$0,\\\$32," } } */