Skip to content

Commit

Permalink
add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
trdthg committed Jul 28, 2024
1 parent 48e0ca1 commit 3019946
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/sailcov/nested_mapping.sail
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
default Order dec
$include <prelude.sail>

union ast = {
B : (bool),
Z : unit
}

mapping bool_not_bits : bool <-> bits(1) = {
true <-> 0b0,
false <-> 0b1
}

mapping encdec : bits(2) <-> ast = {
0b1 @ bool_not_bits(s) if true <-> B(s),
0b00 <-> Z()
}

val main : unit -> unit
function main() = {
let _ = encdec(0b00)
}

0 comments on commit 3019946

Please sign in to comment.