aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/riscv/nozicond-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/riscv/nozicond-2.c')
-rw-r--r--gcc/testsuite/gcc.target/riscv/nozicond-2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/riscv/nozicond-2.c b/gcc/testsuite/gcc.target/riscv/nozicond-2.c
new file mode 100644
index 0000000..f705253
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/nozicond-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { rv64 } } } */
+/* { dg-additional-options "-march=rv64gc_zicond -mabi=lp64d -mbranch-cost=4" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Og" } } */
+
+
+long foo1 (long c) { return c < 0 ? 1 : -1; }
+long foo2 (long c) { return c >= 0 ? -1 : 1; }
+
+/* We don't support 4->3 splitters, so this fails. We could perhaps
+ try to catch it in the expander as a special case rather than waiting
+ for combine. */
+/* { dg-final { scan-assembler-times {srai\t} 2 { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-times {ori\t} 2 { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-times {not\t} 2 { xfail *-*-* } } } */
+