[gcc(refs/vendors/riscv/heads/gcc-15-with-riscv-opts)] RISC-V: Add Zbb extension sext testcase.
Jeff Law
law@gcc.gnu.org
Sat Sep 13 16:29:19 GMT 2025
https://gcc.gnu.org/g:99fdaa3ac2466509917a147204d1effbc82751b5
commit 99fdaa3ac2466509917a147204d1effbc82751b5
Author: Jiawei <jiawei@iscas.ac.cn>
Date: Tue Sep 2 07:51:54 2025 -0600
RISC-V: Add Zbb extension sext testcase.
This patch update RISC-V Zba extension 'sext' instructions generation.
Supplemented the instruction generation detection of 'sext.h' and
'sext.b'.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/zbb-sext.c: New test.
(cherry picked from commit b839cac4d6c3f8be8c4d94a39f59aa7a5fd7271a)
Diff:
---
gcc/testsuite/gcc.target/riscv/zbb-sext.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/gcc/testsuite/gcc.target/riscv/zbb-sext.c b/gcc/testsuite/gcc.target/riscv/zbb-sext.c
new file mode 100644
index 000000000000..1ad3e714371f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/zbb-sext.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=rv64gc_zbb -mabi=lp64" } */
+
+#include<stdint.h>
+
+int8_t foo1(uint8_t a) {
+ return a;
+}
+
+int16_t foo2(uint16_t a) {
+ return a;
+}
+
+/* { dg-final { scan-assembler "sext.b" } } */
+/* { dg-final { scan-assembler "sext.h" } } */
More information about the Gcc-cvs
mailing list