Skip to content

Commit

Permalink
abiTypes: abiTypeInit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed May 31, 2024
1 parent 3b2f01e commit 76c1800
Show file tree
Hide file tree
Showing 16 changed files with 1,238 additions and 866 deletions.
247 changes: 209 additions & 38 deletions cl/_testdata/print/out.ll

Large diffs are not rendered by default.

25 changes: 21 additions & 4 deletions cl/_testdata/vargs/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ source_filename = "main"
@"main.init$guard" = global ptr null
@__llgo_argc = global ptr null
@__llgo_argv = global ptr null
@_llgo_int = linkonce global ptr null
@0 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@1 = private unnamed_addr constant [22 x i8] c"type assertion failed\00", align 1

Expand All @@ -18,6 +19,7 @@ _llgo_0:

_llgo_1: ; preds = %_llgo_0
store i1 true, ptr @"main.init$guard", align 1
call void @"main.init$abi"()
br label %_llgo_2

_llgo_2: ; preds = %_llgo_1, %_llgo_0
Expand All @@ -32,7 +34,7 @@ _llgo_0:
call void @main.init()
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 48)
%3 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %2, i64 0
%4 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
%4 = load ptr, ptr @_llgo_int, align 8
%5 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %5, i32 0, i32 0
store ptr %4, ptr %6, align 8
Expand All @@ -41,7 +43,7 @@ _llgo_0:
%8 = load %"github.com/goplus/llgo/internal/runtime.eface", ptr %5, align 8
store %"github.com/goplus/llgo/internal/runtime.eface" %8, ptr %3, align 8
%9 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %2, i64 1
%10 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
%10 = load ptr, ptr @_llgo_int, align 8
%11 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
%12 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %11, i32 0, i32 0
store ptr %10, ptr %12, align 8
Expand All @@ -50,7 +52,7 @@ _llgo_0:
%14 = load %"github.com/goplus/llgo/internal/runtime.eface", ptr %11, align 8
store %"github.com/goplus/llgo/internal/runtime.eface" %14, ptr %9, align 8
%15 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %2, i64 2
%16 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
%16 = load ptr, ptr @_llgo_int, align 8
%17 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
%18 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %17, i32 0, i32 0
store ptr %16, ptr %18, align 8
Expand Down Expand Up @@ -88,7 +90,7 @@ _llgo_2: ; preds = %_llgo_1
%7 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %6, i64 %3
%8 = load %"github.com/goplus/llgo/internal/runtime.eface", ptr %7, align 8
%9 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %8, 0
%10 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
%10 = load ptr, ptr @_llgo_int, align 8
%11 = icmp eq ptr %9, %10
br i1 %11, label %_llgo_4, label %_llgo_5

Expand Down Expand Up @@ -116,6 +118,21 @@ declare void @"github.com/goplus/llgo/internal/runtime.init"()

declare ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64)

define void @"main.init$abi"() {
_llgo_0:
%0 = load ptr, ptr @_llgo_int, align 8
%1 = icmp eq ptr %0, null
br i1 %1, label %_llgo_1, label %_llgo_2

_llgo_1: ; preds = %_llgo_0
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
store ptr %2, ptr @_llgo_int, align 8
br label %_llgo_2

_llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)

declare void @"github.com/goplus/llgo/internal/runtime.AssertIndexRange"(i1)
Expand Down
5 changes: 1 addition & 4 deletions cl/_testgo/eface/in.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,5 @@ func dump(v any) {

func dumpTyp(t *abi.Type, sep string) {
print(sep)
println(t.Kind(), t.Size_, t.PtrBytes, t.Hash, t.TFlag, t.Align_, t.Str_, t.PtrToThis_)
if t.Elem() != nil {
dumpTyp(t.Elem(), sep+"\t")
}
println(t.Kind(), t.Size_, t.PtrBytes, t.Hash, t.TFlag, t.Align_)
}
483 changes: 308 additions & 175 deletions cl/_testgo/eface/out.ll

Large diffs are not rendered by default.

442 changes: 197 additions & 245 deletions cl/_testgo/errors/out.ll

Large diffs are not rendered by default.

201 changes: 106 additions & 95 deletions cl/_testgo/strucintf/out.ll

Large diffs are not rendered by default.

547 changes: 289 additions & 258 deletions cl/_testgo/struczero/out.ll

Large diffs are not rendered by default.

48 changes: 35 additions & 13 deletions cl/_testrt/any/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ source_filename = "main"

@"main.init$guard" = global ptr null
@"*_llgo_int8" = linkonce global ptr null
@_llgo_int8 = linkonce global ptr null
@0 = private unnamed_addr constant [22 x i8] c"type assertion failed\00", align 1
@_llgo_int = linkonce global ptr null
@1 = private unnamed_addr constant [22 x i8] c"type assertion failed\00", align 1
@__llgo_argc = global ptr null
@__llgo_argv = global ptr null
Expand Down Expand Up @@ -38,7 +40,7 @@ _llgo_2: ; preds = %_llgo_0
define i64 @main.incVal(%"github.com/goplus/llgo/internal/runtime.eface" %0) {
_llgo_0:
%1 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %0, 0
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
%2 = load ptr, ptr @_llgo_int, align 8
%3 = icmp eq ptr %1, %2
br i1 %3, label %_llgo_1, label %_llgo_2

Expand Down Expand Up @@ -87,7 +89,7 @@ _llgo_0:
store ptr @3, ptr %5, align 8
%6 = load %"github.com/goplus/llgo/internal/runtime.eface", ptr %3, align 8
%7 = call ptr @main.hi(%"github.com/goplus/llgo/internal/runtime.eface" %6)
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
%8 = load ptr, ptr @_llgo_int, align 8
%9 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
%10 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %9, i32 0, i32 0
store ptr %8, ptr %10, align 8
Expand All @@ -99,28 +101,48 @@ _llgo_0:
ret i32 0
}

declare void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.eface")

declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)

declare void @"github.com/goplus/llgo/internal/runtime.init"()

declare i32 @printf(ptr, ...)

define void @"main.init$abi"() {
_llgo_0:
%0 = load ptr, ptr @"*_llgo_int8", align 8
%0 = load ptr, ptr @_llgo_int8, align 8
%1 = icmp eq ptr %0, null
br i1 %1, label %_llgo_1, label %_llgo_2

_llgo_1: ; preds = %_llgo_0
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 3)
%3 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %2)
store ptr %3, ptr @"*_llgo_int8", align 8
store ptr %2, ptr @_llgo_int8, align 8
br label %_llgo_2

_llgo_2: ; preds = %_llgo_1, %_llgo_0
%3 = load ptr, ptr @_llgo_int8, align 8
%4 = load ptr, ptr @"*_llgo_int8", align 8
%5 = icmp eq ptr %4, null
br i1 %5, label %_llgo_3, label %_llgo_4

_llgo_3: ; preds = %_llgo_2
%6 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %3)
store ptr %6, ptr @"*_llgo_int8", align 8
br label %_llgo_4

_llgo_4: ; preds = %_llgo_3, %_llgo_2
%7 = load ptr, ptr @_llgo_int, align 8
%8 = icmp eq ptr %7, null
br i1 %8, label %_llgo_5, label %_llgo_6

_llgo_5: ; preds = %_llgo_4
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
store ptr %9, ptr @_llgo_int, align 8
br label %_llgo_6

_llgo_6: ; preds = %_llgo_5, %_llgo_4
ret void
}

declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)

declare ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr)

declare void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.eface")

declare void @"github.com/goplus/llgo/internal/runtime.init"()

declare i32 @printf(ptr, ...)
19 changes: 18 additions & 1 deletion cl/_testrt/builtin/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ source_filename = "main"
@2 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
@3 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
@4 = private unnamed_addr constant [4 x i8] c"def\00", align 1
@_llgo_int = linkonce global ptr null
@5 = private unnamed_addr constant [5 x i8] c"ABCD\00", align 1
@6 = private unnamed_addr constant [8 x i8] c"\E4\B8\ADabcd\00", align 1
@7 = private unnamed_addr constant [8 x i8] c"\E4\B8\ADabcd\00", align 1
Expand Down Expand Up @@ -85,6 +86,7 @@ _llgo_0:

_llgo_1: ; preds = %_llgo_0
store i1 true, ptr @"main.init$guard", align 1
call void @"main.init$abi"()
store i64 9223372036854775807, ptr @main.a, align 4
store i64 -9223372036854775808, ptr @main.b, align 4
store i64 -1, ptr @main.n, align 4
Expand Down Expand Up @@ -323,7 +325,7 @@ _llgo_0:
call void @"github.com/goplus/llgo/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/internal/runtime.Slice" %122)
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
%123 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 16)
%124 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
%124 = load ptr, ptr @_llgo_int, align 8
%125 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
%126 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %125, i32 0, i32 0
store ptr %124, ptr %126, align 8
Expand Down Expand Up @@ -641,6 +643,21 @@ declare void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com

declare %"github.com/goplus/llgo/internal/runtime.Slice" @"github.com/goplus/llgo/internal/runtime.SliceAppend"(%"github.com/goplus/llgo/internal/runtime.Slice", ptr, i64, i64)

define void @"main.init$abi"() {
_llgo_0:
%0 = load ptr, ptr @_llgo_int, align 8
%1 = icmp eq ptr %0, null
br i1 %1, label %_llgo_1, label %_llgo_2

_llgo_1: ; preds = %_llgo_0
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
store ptr %2, ptr @_llgo_int, align 8
br label %_llgo_2

_llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)

declare void @"github.com/goplus/llgo/internal/runtime.PrintBool"(i1)
Expand Down
43 changes: 30 additions & 13 deletions cl/_testrt/cast/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source_filename = "main"

@"main.init$guard" = global ptr null
@0 = private unnamed_addr constant [6 x i8] c"error\00", align 1
@_llgo_string = linkonce global ptr null
@1 = private unnamed_addr constant [6 x i8] c"error\00", align 1
@2 = private unnamed_addr constant [6 x i8] c"error\00", align 1
@3 = private unnamed_addr constant [6 x i8] c"error\00", align 1
Expand Down Expand Up @@ -34,7 +35,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -63,7 +64,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -92,7 +93,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -121,7 +122,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -150,7 +151,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -179,7 +180,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -208,7 +209,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -237,7 +238,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -266,7 +267,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -295,7 +296,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -324,7 +325,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand Down Expand Up @@ -353,7 +354,7 @@ _llgo_1: ; preds = %_llgo_0
%6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %4, i32 0, i32 1
store i64 5, ptr %6, align 4
%7 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %4, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%8 = load ptr, ptr @_llgo_string, align 8
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %7, ptr %9, align 8
%10 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand All @@ -377,7 +378,7 @@ _llgo_3: ; preds = %_llgo_2
%18 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %16, i32 0, i32 1
store i64 5, ptr %18, align 4
%19 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %16, align 8
%20 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%20 = load ptr, ptr @_llgo_string, align 8
%21 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" %19, ptr %21, align 8
%22 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
Expand All @@ -400,6 +401,7 @@ _llgo_0:

_llgo_1: ; preds = %_llgo_0
store i1 true, ptr @"main.init$guard", align 1
call void @"main.init$abi"()
br label %_llgo_2

_llgo_2: ; preds = %_llgo_1, %_llgo_0
Expand Down Expand Up @@ -470,6 +472,21 @@ _llgo_0:
ret i32 0
}

define void @"main.init$abi"() {
_llgo_0:
%0 = load ptr, ptr @_llgo_string, align 8
%1 = icmp eq ptr %0, null
br i1 %1, label %_llgo_1, label %_llgo_2

_llgo_1: ; preds = %_llgo_0
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
store ptr %2, ptr @_llgo_string, align 8
br label %_llgo_2

_llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)

declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64)
Expand Down
Loading

0 comments on commit 76c1800

Please sign in to comment.