LLVMSharp icon indicating copy to clipboard operation
LLVMSharp copied to clipboard

Add HelloWorld sample of LLVMSharp16

Open CWKSC opened this issue 2 years ago • 0 comments

Refer to https://github.com/dotnet/LLVMSharp/pull/206

I change to use type-safe extensions that already exist in the project.

This HelloWorld sample will output:

[Output of LLVM IR]:

; ModuleID = 'Hello World'
source_filename = "Hello World"

@0 = private unnamed_addr constant [13 x i8] c"Hello World!\00", align 1

declare i32 @puts(ptr %0)

define i32 @main() {
entry:
  %0 = call i32 @puts(ptr @0)
  ret i32 0
}

[Output of Execution Engine]:

Hello World!

CWKSC avatar Jul 04 '23 18:07 CWKSC