Add more test programs

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-05-08 23:30:23 -07:00
parent 838aaf9c58
commit c1581075d3

View File

@ -13,6 +13,25 @@ testCode =
"neg" ((` "zero") Expr.- (# 1)) then "neg" ((` "zero") Expr.- (# 1)) then
"unknown" ((` "pos") Expr.+ (` "neg")) "unknown" ((` "pos") Expr.+ (` "neg"))
testCodeCond₁ : Stmt
testCodeCond₁ =
"var" (# 1) then
if (` "var") then (
"var" ((` "var") Expr.+ (# 1))
) else (
"var" ((` "var") Expr.- (# 1)) then
"var" (# 1)
)
testCodeCond₂ : Stmt
testCodeCond₂ =
"var" (# 1) then
if (` "var") then (
"x" (# 1)
) else (
noop
)
testProgram : Program testProgram : Program
testProgram = record testProgram = record
{ rootStmt = testCode { rootStmt = testCode