Source

TyLLVM / main.ml

let () =
  LLVM.print_context_module
    (LLVM.new_global
      ~link_type:(Some `Internal)
      ~constant:true
      "msg" (LLVM.Array (13, LLVM.Int 8)));
  LLVM.print_context_module
    (LLVM.new_declaration
      (LLVM.Int 32) "puts" [| LLVM.Pointer (LLVM.Int 8); LLVM.Int 32 |]
      ~link_type: (Some `External));
  LLVM.print_context_module
    (LLVM.new_definition
      (LLVM.Int 32) "main" [||] [LLVM.Ret])