boot2

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

000-fn-empty.scm (277B)


      1 ;; tests/cc-cg/000-fn-empty.scm — minimal direct-cg test.
      2 ;; Models: int main(void) { return 0; }
      3 ;; Runtime: exits 0.
      4 
      5 (let ((cg (cg-init)))
      6   (cg-fn-begin cg "main" '() %t-i32)
      7   (cg-push-imm cg %t-i32 0)
      8   (cg-return cg)
      9   (cg-fn-end cg)
     10   (write-bv-fd 1 (cg-finish cg)))