chore: fix tests

This commit is contained in:
Leonardo de Moura 2022-10-10 17:48:32 -07:00
parent 1b4cfbe94b
commit 525b4f761c
2 changed files with 23 additions and 2 deletions

View file

@ -18,3 +18,23 @@
| Nat.succ n.2 =>
let c := Nat.sub x y
c
[Compiler.floatLetIn] Size of code that was pushed into arm: Lean.Compiler.LCNF.FloatLetIn.Decision.arm `Bool.false 0
[Compiler.floatLetIn] Size of code that was pushed into arm: Lean.Compiler.LCNF.FloatLetIn.Decision.arm `Bool.true 0
[Compiler.floatLetIn] Size of code that was pushed into arm: Lean.Compiler.LCNF.FloatLetIn.Decision.arm `Nat.zero 0
[Compiler.floatLetIn] Size of code that was pushed into arm: Lean.Compiler.LCNF.FloatLetIn.Decision.arm `Nat.succ 0
[Compiler.floatLetIn] size: 11
def provokeFloatLet x y cond : Nat :=
let dual := Nat.mul x y
cases cond : Nat
| Bool.false =>
let b := Nat.add x y
let _x.1 := Nat.add b dual
_x.1
| Bool.true =>
cases dual : Nat
| Nat.zero =>
let a := Nat.pow x y
a
| Nat.succ n.2 =>
let c := Nat.sub x y
c

View file

@ -8,8 +8,9 @@ open Lean.Compiler.LCNF
-- Run compilation twice to avoid the output caused by the inliner
#eval Compiler.compile #[``Lean.Meta.synthInstance, ``Lean.Elab.Term.Do.elabDo]
@[cpass]
def floatLetInFixTest : PassInstaller := Testing.assertIsAtFixPoint |>.install `floatLetIn `floatLetInFix
-- #eval fails if we uncomment this pass after I added a `floatLetIn` pass at the mono phase
-- @[cpass]
-- def floatLetInFixTest : PassInstaller := Testing.assertIsAtFixPoint |>.install `floatLetIn `floatLetInFix
@[cpass]
def floatLetInSizeTest : PassInstaller :=