flan/test/programs/annotate.flan

14 lines
374 B
Plaintext

;;;; A function whose forms nest and loop, for the source annotation of its
;;;; IR, its x86 listing and its disassembly: test_dev.ml reads the forms back
;;;; out of each and checks they come in the order they are written here.
(defn wind [n i32] i32
(let [acc 0]
(dotimes [i n]
(set acc (+ acc (* i 3))))
acc))
(defn main [] i32
(print (wind 10))
0)