Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Add cmov test
Browse files Browse the repository at this point in the history
  • Loading branch information
rdolbeau committed Jun 7, 2021
1 parent 38f0701 commit 3af2ee4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gcc/testsuite/gcc.target/riscv/rvb-zbt-cmov.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* { dg-do compile } */
/* { dg-options "-march=rv32gc_zbt -O2" { target { riscv32*-*-* } } } */
/* { dg-options "-march=rv64gc_zbt -O2" { target { riscv64*-*-* } } } */

long cmov(long s, long b, long c) {
return (s ? b : c);
}
long cmov2(long s, long b, long c) {
return (s == 0 ? b : c);
}

/* { dg-final { scan-assembler-times "cmov\t" 2 } } */

0 comments on commit 3af2ee4

Please sign in to comment.