Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Oct 9, 2024
1 parent 827c4ed commit 97a114f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/Tree/Eval/Positive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,10 @@ tests =
"Test041: Type unification"
$(mkRelDir ".")
$(mkRelFile "test041.jvt")
$(mkRelFile "out/test041.out")
$(mkRelFile "out/test041.out"),
PosTest
"Test042: Uncurried function type unification"
$(mkRelDir ".")
$(mkRelFile "test042.jvt")
$(mkRelFile "out/test042.out")
]
1 change: 1 addition & 0 deletions tests/Tree/positive/out/test042.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
true
25 changes: 25 additions & 0 deletions tests/Tree/positive/test042.jvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
type Eq {
mkEq : ((*, *) → bool) → Eq;
}

function lambda_app(f : (*, *) → bool, a : *, b : *) : bool {
ccall(f, a, b)
}

function spec(Eq) : Eq {
alloc[mkEq](calloc[lambda_app](case[Eq](arg[0]) {
mkEq: save {
tmp[0].mkEq[0]
}
}))
}

function cmp(integer, integer) : bool {
lt(arg[0], arg[1])
}

function main() : bool {
save(call[spec](alloc[mkEq](calloc[cmp]()))) {
ccall(tmp[0].mkEq[0], 1, 2)
}
}

0 comments on commit 97a114f

Please sign in to comment.