boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

004-binop-add.scm (302B)


      1 ;; tests/cc-cg/04-binop-add.scm — return 3 + 4 as i32.
      2 ;; Exercises cg-binop on two imm rvals.
      3 
      4 (let ((cg (cg-init)))
      5   (cg-fn-begin cg "main" '() %t-i32)
      6   (cg-push-imm cg %t-i32 3)
      7   (cg-push-imm cg %t-i32 4)
      8   (cg-binop cg 'add)
      9   (cg-return cg)
     10   (cg-fn-end cg)
     11   (write-bv-fd 1 (cg-finish cg)))