xls
xls copied to clipboard
Tests with single match arm
Really we should add generation of match constructs to the fuzzer. Found a bug in single-arm matches (just a single wildcard arm) where the JIT miscompares with the DSL.
This was the test case that caused a miscompare between the JIT and the DSL interpreter:
fn [N: u8] p(_: bits[N]) -> u8 {
N
}
fn f() -> u8 {
match false {
_ => p(u8:0)
}
}
test t {
assert_eq(u8:8, f())
}
Seems like a small bug with the degenerate case (only one thing to select) XLS->LLVM IR translation of one hot select.