(module main)

(fn add_local ((a i32)) -> i32
  (let one i32 1)
  (var total i32 (+ a one))
  (set total (+ total 1))
  total)

(test "locals work"
  (let base i32 2)
  (var value i32 (add_local base))
  (set value (+ value 1))
  (= value 5))

(fn main () -> i32
  (add_local 2))
