Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ineol authored and Alasdair committed Feb 13, 2025
1 parent dc3751e commit bbad0f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/lean/implicit.expected.lean
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ def EXTZ {m : _} (v : (BitVec k_n)) : (BitVec m) :=
def foo (x : (BitVec 8)) : (BitVec 16) :=
(EXTZ x)

/-- Type quantifiers: k_ex868# : Bool, n : Nat, n ≥ 0 -/
def slice_mask2 {n : _} (i : (BitVec n)) (l : (BitVec n)) (b : Bool) : (BitVec n) :=
if b
then i
else let one : (BitVec n) := (EXTZ l)
(HAdd.hAdd one one)

def initialize_registers (_ : Unit) : Unit :=
()

9 changes: 9 additions & 0 deletions test/lean/implicit.sail
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ val foo : bits(8) -> bits(16)
function foo x = {
EXTZ(x)
}

val slice_mask2 : forall 'n, 'n >= 0. (implicit('n), bits('n), bits('n), bool) -> bits('n)
function slice_mask2(n,i,l,b) =
if b then {
i
} else {
let one : bits('n) = EXTZ(n, l) in
one + one
}

0 comments on commit bbad0f3

Please sign in to comment.