2024-05-02 23:14:12 +08:00
|
|
|
; ModuleID = 'main'
|
|
|
|
|
source_filename = "main"
|
|
|
|
|
|
2024-05-29 09:36:53 +08:00
|
|
|
%"github.com/goplus/llgo/internal/runtime.String" = type { ptr, i64 }
|
|
|
|
|
%main.m = type { %"github.com/goplus/llgo/internal/runtime.String" }
|
|
|
|
|
|
2024-05-02 23:14:12 +08:00
|
|
|
@"main.init$guard" = global ptr null
|
2024-05-07 10:16:03 +08:00
|
|
|
@__llgo_argc = global ptr null
|
|
|
|
|
@__llgo_argv = global ptr null
|
2024-05-02 23:14:12 +08:00
|
|
|
@0 = private unnamed_addr constant [2 x i8] c"a\00", align 1
|
|
|
|
|
@1 = private unnamed_addr constant [2 x i8] c"b\00", align 1
|
|
|
|
|
@2 = private unnamed_addr constant [2 x i8] c"c\00", align 1
|
|
|
|
|
@3 = private unnamed_addr constant [2 x i8] c"d\00", align 1
|
|
|
|
|
@4 = private unnamed_addr constant [2 x i8] c"1\00", align 1
|
|
|
|
|
@5 = private unnamed_addr constant [2 x i8] c"2\00", align 1
|
|
|
|
|
@6 = private unnamed_addr constant [2 x i8] c"3\00", align 1
|
|
|
|
|
@7 = private unnamed_addr constant [2 x i8] c"4\00", align 1
|
2024-05-29 09:36:53 +08:00
|
|
|
@8 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
|
|
|
|
|
|
|
|
|
|
declare %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/cl/internal/linktarget.m.info"(%main.m)
|
2024-05-02 23:14:12 +08:00
|
|
|
|
|
|
|
|
define void @main.init() {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
%0 = load i1, ptr @"main.init$guard", align 1
|
|
|
|
|
br i1 %0, label %_llgo_2, label %_llgo_1
|
|
|
|
|
|
|
|
|
|
_llgo_1: ; preds = %_llgo_0
|
|
|
|
|
store i1 true, ptr @"main.init$guard", align 1
|
2024-05-29 09:36:53 +08:00
|
|
|
call void @"github.com/goplus/llgo/cl/internal/linktarget.init"()
|
2024-05-02 23:14:12 +08:00
|
|
|
br label %_llgo_2
|
|
|
|
|
|
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|
|
|
|
ret void
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-17 09:48:21 +08:00
|
|
|
define i32 @main(i32 %0, ptr %1) {
|
2024-05-02 23:14:12 +08:00
|
|
|
_llgo_0:
|
2024-05-07 10:16:03 +08:00
|
|
|
store i32 %0, ptr @__llgo_argc, align 4
|
|
|
|
|
store ptr %1, ptr @__llgo_argv, align 8
|
2024-05-02 23:14:12 +08:00
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.init"()
|
|
|
|
|
call void @main.init()
|
|
|
|
|
call void @"github.com/goplus/llgo/cl/internal/linktarget.F"(ptr @0, ptr @1, ptr @2, ptr @3)
|
|
|
|
|
call void @"github.com/goplus/llgo/cl/internal/linktarget.F"(ptr @4, ptr @5, ptr @6, ptr @7)
|
2024-05-29 09:36:53 +08:00
|
|
|
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 16)
|
|
|
|
|
%3 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%4 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %3, i32 0, i32 0
|
|
|
|
|
store ptr @8, ptr %4, align 8
|
|
|
|
|
%5 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %3, i32 0, i32 1
|
|
|
|
|
store i64 5, ptr %5, align 4
|
|
|
|
|
%6 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %3, align 8
|
|
|
|
|
call void @"github.com/goplus/llgo/cl/internal/linktarget.(*m).setInfo"(ptr %2, %"github.com/goplus/llgo/internal/runtime.String" %6)
|
|
|
|
|
%7 = load %main.m, ptr %2, align 8
|
|
|
|
|
%8 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/cl/internal/linktarget.m.info"(%main.m %7)
|
|
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String" %8)
|
|
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
2024-05-17 09:48:21 +08:00
|
|
|
ret i32 0
|
2024-05-02 23:14:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare void @"github.com/goplus/llgo/cl/internal/linktarget.F"(ptr, ptr, ptr, ptr)
|
|
|
|
|
|
2024-05-29 09:36:53 +08:00
|
|
|
declare void @"github.com/goplus/llgo/cl/internal/linktarget.(*m).setInfo"(ptr, %"github.com/goplus/llgo/internal/runtime.String")
|
|
|
|
|
|
|
|
|
|
declare void @"github.com/goplus/llgo/cl/internal/linktarget.init"()
|
|
|
|
|
|
2024-05-02 23:14:12 +08:00
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.init"()
|
2024-05-29 09:36:53 +08:00
|
|
|
|
|
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64)
|
|
|
|
|
|
|
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String")
|
|
|
|
|
|
|
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8)
|