lean4-htt/tests/lean/run/inlineApp.lean
Cameron Zwarich 361ca788a7
refactor: split the LCNF pass list into separate base/mono lists (#9816)
This will make it easier to run the two phases in parallel.
2025-08-10 04:23:19 +00:00

16 lines
402 B
Text

import Lean
def f (x : Nat) :=
(x - 1) + x * 2 + x*x
def h (x : Nat) :=
inline <| f (x + x)
#eval Lean.Compiler.compile #[``h]
open Lean Compiler LCNF in
@[cpass] def simpInline : PassInstaller :=
Testing.assertDoesNotContainConstAfter .mono ``inline "simp did not inline `inline`" |>.install `simp `simpInlinesInline
set_option trace.Compiler.result true
#eval Lean.Compiler.compile #[``h]