diff --git a/compiler/cl/_testdata/fncall/out.ll b/compiler/cl/_testdata/fncall/out.ll index 1b0ec249..35c86344 100644 --- a/compiler/cl/_testdata/fncall/out.ll +++ b/compiler/cl/_testdata/fncall/out.ll @@ -1,34 +1,28 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/fncall' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/fncall" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/fncall.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/fncall.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/fncall.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/fncall.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/fncall.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call i64 @main.max(i64 1, i64 2) - ret i32 0 + %0 = call i64 @"github.com/goplus/llgo/compiler/cl/_testdata/fncall.max"(i64 1, i64 2) + ret void } -define i64 @main.max(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testdata/fncall.max"(i64 %0, i64 %1) { _llgo_0: %2 = icmp sgt i64 %0, %1 br i1 %2, label %_llgo_1, label %_llgo_2 @@ -39,5 +33,3 @@ _llgo_1: ; preds = %_llgo_0 _llgo_2: ; preds = %_llgo_0 ret i64 %1 } - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testdata/importpkg/out.ll b/compiler/cl/_testdata/importpkg/out.ll index 8142bfc9..bcec4c74 100644 --- a/compiler/cl/_testdata/importpkg/out.ll +++ b/compiler/cl/_testdata/importpkg/out.ll @@ -1,47 +1,39 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/importpkg' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/importpkg" -@main.hello = global [7 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.hello" = global [7 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.init$guard", align 1 call void @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio.init"() - store i8 72, ptr @main.hello, align 1 - store i8 101, ptr getelementptr inbounds (i8, ptr @main.hello, i64 1), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.hello, i64 2), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.hello, i64 3), align 1 - store i8 111, ptr getelementptr inbounds (i8, ptr @main.hello, i64 4), align 1 - store i8 10, ptr getelementptr inbounds (i8, ptr @main.hello, i64 5), align 1 - store i8 0, ptr getelementptr inbounds (i8, ptr @main.hello, i64 6), align 1 + store i8 72, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.hello", align 1 + store i8 101, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.hello", i64 1), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.hello", i64 2), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.hello", i64 3), align 1 + store i8 111, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.hello", i64 4), align 1 + store i8 10, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.hello", i64 5), align 1 + store i8 0, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.hello", i64 6), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio.Max"(i64 2, i64 100) - call void (ptr, ...) @printf(ptr @main.hello) - ret i32 0 + %0 = call i64 @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio.Max"(i64 2, i64 100) + call void (ptr, ...) @printf(ptr @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg.hello") + ret void } declare void @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i64 @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio.Max"(i64, i64) declare void @printf(ptr, ...) diff --git a/compiler/cl/_testdata/method/out.ll b/compiler/cl/_testdata/method/out.ll index a789cd42..3ddfa828 100644 --- a/compiler/cl/_testdata/method/out.ll +++ b/compiler/cl/_testdata/method/out.ll @@ -1,58 +1,50 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/method' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/method" -@main.format = global [10 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/method.format" = global [10 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testdata/method.init$guard" = global i1 false, align 1 -define i64 @main.T.Add(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testdata/method.T.Add"(i64 %0, i64 %1) { _llgo_0: %2 = add i64 %0, %1 ret i64 %2 } -define i64 @"main.(*T).Add"(ptr %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testdata/method.(*T).Add"(ptr %0, i64 %1) { _llgo_0: %2 = load i64, ptr %0, align 4 - %3 = call i64 @main.T.Add(i64 %2, i64 %1) + %3 = call i64 @"github.com/goplus/llgo/compiler/cl/_testdata/method.T.Add"(i64 %2, i64 %1) ret i64 %3 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/method.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.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 - store i8 72, ptr @main.format, align 1 - store i8 101, ptr getelementptr inbounds (i8, ptr @main.format, i64 1), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 2), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 3), align 1 - store i8 111, ptr getelementptr inbounds (i8, ptr @main.format, i64 4), align 1 - store i8 32, ptr getelementptr inbounds (i8, ptr @main.format, i64 5), align 1 - store i8 37, ptr getelementptr inbounds (i8, ptr @main.format, i64 6), align 1 - store i8 100, ptr getelementptr inbounds (i8, ptr @main.format, i64 7), align 1 - store i8 10, ptr getelementptr inbounds (i8, ptr @main.format, i64 8), align 1 - store i8 0, ptr getelementptr inbounds (i8, ptr @main.format, i64 9), align 1 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.init$guard", align 1 + store i8 72, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", align 1 + store i8 101, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 1), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 2), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 3), align 1 + store i8 111, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 4), align 1 + store i8 32, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 5), align 1 + store i8 37, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 6), align 1 + store i8 100, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 7), align 1 + store i8 10, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 8), align 1 + store i8 0, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 9), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/method.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call i64 @main.T.Add(i64 1, i64 2) - call void (ptr, ...) @printf(ptr @main.format, i64 %2) - ret i32 0 + %0 = call i64 @"github.com/goplus/llgo/compiler/cl/_testdata/method.T.Add"(i64 1, i64 2) + call void (ptr, ...) @printf(ptr @"github.com/goplus/llgo/compiler/cl/_testdata/method.format", i64 %0) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @printf(ptr, ...) diff --git a/compiler/cl/_testdata/print/out.ll b/compiler/cl/_testdata/print/out.ll index d6ed4ecd..1f14752b 100644 --- a/compiler/cl/_testdata/print/out.ll +++ b/compiler/cl/_testdata/print/out.ll @@ -1,17 +1,15 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/print' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/print" %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.stringStruct = type { ptr, i64 } -%main.slice = type { ptr, i64, i64 } +%"github.com/goplus/llgo/compiler/cl/_testdata/print.stringStruct" = type { ptr, i64 } +%"github.com/goplus/llgo/compiler/cl/_testdata/print.slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@main.minhexdigits = global i64 0, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/print.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testdata/print.minhexdigits" = global i64 0, align 8 @0 = private unnamed_addr constant [3 x i8] c"%c\00", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @1 = private unnamed_addr constant [4 x i8] c"llgo", align 1 @_llgo_float32 = linkonce global ptr null, align 8 @_llgo_float64 = linkonce global ptr null, align 8 @@ -44,29 +42,29 @@ source_filename = "main" @13 = private unnamed_addr constant [1 x i8] c" ", align 1 @14 = private unnamed_addr constant [1 x i8] c"\0A", align 1 -define %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @main.bytes(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testdata/print.bytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) store %"github.com/goplus/llgo/runtime/internal/runtime.String" %0, ptr %1, align 8 %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %3 = call ptr @main.stringStructOf(ptr %1) - %4 = getelementptr inbounds %main.stringStruct, ptr %3, i32 0, i32 0 + %3 = call ptr @"github.com/goplus/llgo/compiler/cl/_testdata/print.stringStructOf"(ptr %1) + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testdata/print.stringStruct", ptr %3, i32 0, i32 0 %5 = load ptr, ptr %4, align 8 - %6 = getelementptr inbounds %main.slice, ptr %2, i32 0, i32 0 + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testdata/print.slice", ptr %2, i32 0, i32 0 store ptr %5, ptr %6, align 8 - %7 = getelementptr inbounds %main.stringStruct, ptr %3, i32 0, i32 1 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testdata/print.stringStruct", ptr %3, i32 0, i32 1 %8 = load i64, ptr %7, align 4 - %9 = getelementptr inbounds %main.slice, ptr %2, i32 0, i32 1 + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testdata/print.slice", ptr %2, i32 0, i32 1 store i64 %8, ptr %9, align 4 - %10 = getelementptr inbounds %main.stringStruct, ptr %3, i32 0, i32 1 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testdata/print.stringStruct", ptr %3, i32 0, i32 1 %11 = load i64, ptr %10, align 4 - %12 = getelementptr inbounds %main.slice, ptr %2, i32 0, i32 2 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testdata/print.slice", ptr %2, i32 0, i32 2 store i64 %11, ptr %12, align 4 %13 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %2, align 8 ret %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %13 } -define void @main.gwrite(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.gwrite"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, 1 %2 = icmp eq i64 %1, 0 @@ -101,216 +99,212 @@ _llgo_5: ; preds = %_llgo_3 ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/print.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 - call void @"main.init$after"() - store i64 0, ptr @main.minhexdigits, align 4 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/print.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.init$after"() + store i64 0, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/print.minhexdigits", align 4 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }) - call void @main.printnl() - call void @main.printuint(i64 1024) - call void @main.printnl() - call void @main.printhex(i64 305441743) - call void @main.printnl() - call void @main.prinxor(i64 1) - call void @main.printnl() - call void @main.prinsub(i64 100) - call void @main.printnl() - call void @main.prinusub(i64 -1) - call void @main.printnl() - call void @main.prinfsub(double 1.001000e+02) - call void @main.printnl() - %2 = load ptr, ptr @_llgo_float32, align 8 - %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 - %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, ptr inttoptr (i32 1315859240 to ptr), 1 - call void @main.printany(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %4) - call void @main.printnl() - %5 = load ptr, ptr @_llgo_float64, align 8 - %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %5, 0 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr inttoptr (i64 4746175415993761792 to ptr), 1 - call void @main.printany(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %7) - call void @main.printnl() + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 1024) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printhex"(i64 305441743) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.prinxor"(i64 1) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.prinsub"(i64 100) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.prinusub"(i64 -1) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.prinfsub"(double 1.001000e+02) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() + %0 = load ptr, ptr @_llgo_float32, align 8 + %1 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 + %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %1, ptr inttoptr (i32 1315859240 to ptr), 1 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printany"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %2) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() + %3 = load ptr, ptr @_llgo_float64, align 8 + %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %4, ptr inttoptr (i64 4746175415993761792 to ptr), 1 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printany"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %5) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() br i1 true, label %_llgo_3, label %_llgo_2 _llgo_1: ; preds = %_llgo_3 - %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %9 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %8, i64 0 - %10 = load ptr, ptr @_llgo_string, align 8 - %11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 10 }, ptr %11, align 8 - %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %10, 0 - %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %12, ptr %11, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, ptr %9, align 8 - %14 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %8, i64 1 - %15 = load ptr, ptr @_llgo_bool, align 8 - %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %15, 0 - %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %16, ptr inttoptr (i64 -1 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %17, ptr %14, align 8 - %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %8, 0 - %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18, i64 2, 1 - %20 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19, i64 2, 2 - call void @main.println(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %20) + %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %7 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %6, i64 0 + %8 = load ptr, ptr @_llgo_string, align 8 + %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 10 }, ptr %9, align 8 + %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %8, 0 + %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, ptr %9, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %11, ptr %7, align 8 + %12 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %6, i64 1 + %13 = load ptr, ptr @_llgo_bool, align 8 + %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %13, 0 + %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %14, ptr inttoptr (i64 -1 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %15, ptr %12, align 8 + %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %6, 0 + %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16, i64 2, 1 + %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, i64 2, 2 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.println"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18) br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_3, %_llgo_0 - %21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48) - %22 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %21, i64 0 - %23 = load ptr, ptr @_llgo_string, align 8 - %24 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 8 }, ptr %24, align 8 - %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %23, 0 - %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %25, ptr %24, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %26, ptr %22, align 8 - %27 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %21, i64 1 - %28 = load ptr, ptr @_llgo_bool, align 8 - %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %28, 0 - %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %29, ptr inttoptr (i64 -1 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %30, ptr %27, align 8 - %31 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %21, i64 2 - %32 = load ptr, ptr @_llgo_bool, align 8 - %33 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %32, 0 - %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %33, ptr inttoptr (i64 -1 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %34, ptr %31, align 8 - %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %21, 0 - %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35, i64 3, 1 - %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36, i64 3, 2 - call void @main.println(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37) - %38 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 256) - %39 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 0 - %40 = load ptr, ptr @_llgo_bool, align 8 - %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %40, 0 - %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %41, ptr inttoptr (i64 -1 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %42, ptr %39, align 8 - %43 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 1 - %44 = load ptr, ptr @_llgo_bool, align 8 - %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %44, 0 - %46 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %45, ptr null, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %46, ptr %43, align 8 - %47 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 2 - %48 = load ptr, ptr @_llgo_int32, align 8 - %49 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %48, 0 - %50 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %49, ptr inttoptr (i64 97 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %50, ptr %47, align 8 - %51 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 3 - %52 = load ptr, ptr @_llgo_int32, align 8 - %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %52, 0 - %54 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %53, ptr inttoptr (i64 65 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %54, ptr %51, align 8 - %55 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 4 - %56 = load ptr, ptr @_llgo_int32, align 8 - %57 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %56, 0 - %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %57, ptr inttoptr (i64 20013 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %58, ptr %55, align 8 - %59 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 5 - %60 = load ptr, ptr @_llgo_int8, align 8 - %61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %60, 0 - %62 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %61, ptr inttoptr (i64 1 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %62, ptr %59, align 8 - %63 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 6 - %64 = load ptr, ptr @_llgo_int16, align 8 - %65 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %64, 0 - %66 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %65, ptr inttoptr (i64 2 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %66, ptr %63, align 8 - %67 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 7 - %68 = load ptr, ptr @_llgo_int32, align 8 - %69 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %68, 0 - %70 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %69, ptr inttoptr (i64 3 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %70, ptr %67, align 8 - %71 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 8 - %72 = load ptr, ptr @_llgo_int64, align 8 - %73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %72, 0 - %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %73, ptr inttoptr (i64 4 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %74, ptr %71, align 8 - %75 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 9 - %76 = load ptr, ptr @_llgo_int, align 8 - %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %76, 0 - %78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %77, ptr inttoptr (i64 5 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %78, ptr %75, align 8 - %79 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 10 - %80 = load ptr, ptr @_llgo_byte, align 8 - %81 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %80, 0 - %82 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %81, ptr inttoptr (i64 1 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %82, ptr %79, align 8 - %83 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 11 - %84 = load ptr, ptr @_llgo_uint16, align 8 - %85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %84, 0 - %86 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %85, ptr inttoptr (i64 2 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %86, ptr %83, align 8 - %87 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 12 - %88 = load ptr, ptr @_llgo_uint32, align 8 - %89 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %88, 0 - %90 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %89, ptr inttoptr (i64 3 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %90, ptr %87, align 8 - %91 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 13 - %92 = load ptr, ptr @_llgo_uint64, align 8 - %93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %92, 0 - %94 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %93, ptr inttoptr (i64 4 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %94, ptr %91, align 8 - %95 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 14 - %96 = load ptr, ptr @_llgo_uintptr, align 8 - %97 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %96, 0 - %98 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %97, ptr inttoptr (i64 5 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %98, ptr %95, align 8 - %99 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 15 - %100 = load ptr, ptr @_llgo_string, align 8 - %101 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, ptr %101, align 8 - %102 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %100, 0 - %103 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %102, ptr %101, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %103, ptr %99, align 8 - %104 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %38, 0 - %105 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %104, i64 16, 1 - %106 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %105, i64 16, 2 - call void @main.println(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %106) - %107 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %108 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %107, i64 0 - %109 = load ptr, ptr @_llgo_complex128, align 8 - %110 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store { double, double } { double 1.000000e+00, double 2.000000e+00 }, ptr %110, align 8 - %111 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %109, 0 - %112 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %111, ptr %110, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %112, ptr %108, align 8 - %113 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %107, 0 - %114 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %113, i64 1, 1 - %115 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %114, i64 1, 2 - call void @main.println(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %115) - ret i32 0 + %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48) + %20 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %19, i64 0 + %21 = load ptr, ptr @_llgo_string, align 8 + %22 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 8 }, ptr %22, align 8 + %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %21, 0 + %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %23, ptr %22, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %24, ptr %20, align 8 + %25 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %19, i64 1 + %26 = load ptr, ptr @_llgo_bool, align 8 + %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %26, 0 + %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %27, ptr inttoptr (i64 -1 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %28, ptr %25, align 8 + %29 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %19, i64 2 + %30 = load ptr, ptr @_llgo_bool, align 8 + %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %30, 0 + %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %31, ptr inttoptr (i64 -1 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %32, ptr %29, align 8 + %33 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %19, 0 + %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %33, i64 3, 1 + %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %34, i64 3, 2 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.println"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35) + %36 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 256) + %37 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 0 + %38 = load ptr, ptr @_llgo_bool, align 8 + %39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %38, 0 + %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %39, ptr inttoptr (i64 -1 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %40, ptr %37, align 8 + %41 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 1 + %42 = load ptr, ptr @_llgo_bool, align 8 + %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %42, 0 + %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %43, ptr null, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %44, ptr %41, align 8 + %45 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 2 + %46 = load ptr, ptr @_llgo_int32, align 8 + %47 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %46, 0 + %48 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %47, ptr inttoptr (i64 97 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %48, ptr %45, align 8 + %49 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 3 + %50 = load ptr, ptr @_llgo_int32, align 8 + %51 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %50, 0 + %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %51, ptr inttoptr (i64 65 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %52, ptr %49, align 8 + %53 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 4 + %54 = load ptr, ptr @_llgo_int32, align 8 + %55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %54, 0 + %56 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %55, ptr inttoptr (i64 20013 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %56, ptr %53, align 8 + %57 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 5 + %58 = load ptr, ptr @_llgo_int8, align 8 + %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %58, 0 + %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %59, ptr inttoptr (i64 1 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %60, ptr %57, align 8 + %61 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 6 + %62 = load ptr, ptr @_llgo_int16, align 8 + %63 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %62, 0 + %64 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %63, ptr inttoptr (i64 2 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %64, ptr %61, align 8 + %65 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 7 + %66 = load ptr, ptr @_llgo_int32, align 8 + %67 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %66, 0 + %68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %67, ptr inttoptr (i64 3 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %68, ptr %65, align 8 + %69 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 8 + %70 = load ptr, ptr @_llgo_int64, align 8 + %71 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %70, 0 + %72 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %71, ptr inttoptr (i64 4 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %72, ptr %69, align 8 + %73 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 9 + %74 = load ptr, ptr @_llgo_int, align 8 + %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %74, 0 + %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %75, ptr inttoptr (i64 5 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %76, ptr %73, align 8 + %77 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 10 + %78 = load ptr, ptr @_llgo_byte, align 8 + %79 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %78, 0 + %80 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %79, ptr inttoptr (i64 1 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %80, ptr %77, align 8 + %81 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 11 + %82 = load ptr, ptr @_llgo_uint16, align 8 + %83 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %82, 0 + %84 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %83, ptr inttoptr (i64 2 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %84, ptr %81, align 8 + %85 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 12 + %86 = load ptr, ptr @_llgo_uint32, align 8 + %87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %86, 0 + %88 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %87, ptr inttoptr (i64 3 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %88, ptr %85, align 8 + %89 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 13 + %90 = load ptr, ptr @_llgo_uint64, align 8 + %91 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %90, 0 + %92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %91, ptr inttoptr (i64 4 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %92, ptr %89, align 8 + %93 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 14 + %94 = load ptr, ptr @_llgo_uintptr, align 8 + %95 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %94, 0 + %96 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %95, ptr inttoptr (i64 5 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %96, ptr %93, align 8 + %97 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %36, i64 15 + %98 = load ptr, ptr @_llgo_string, align 8 + %99 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, ptr %99, align 8 + %100 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %98, 0 + %101 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %100, ptr %99, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %101, ptr %97, align 8 + %102 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %36, 0 + %103 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %102, i64 16, 1 + %104 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %103, i64 16, 2 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.println"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %104) + %105 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + %106 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %105, i64 0 + %107 = load ptr, ptr @_llgo_complex128, align 8 + %108 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store { double, double } { double 1.000000e+00, double 2.000000e+00 }, ptr %108, align 8 + %109 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %107, 0 + %110 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %109, ptr %108, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %110, ptr %106, align 8 + %111 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %105, 0 + %112 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %111, i64 1, 1 + %113 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %112, i64 1, 2 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.println"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %113) + ret void _llgo_3: ; preds = %_llgo_0 br i1 true, label %_llgo_1, label %_llgo_2 } -define void @main.prinfsub(double %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.prinfsub"(double %0) { _llgo_0: %1 = fneg double %0 - call void @main.printfloat(double %1) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printfloat"(double %1) ret void } -define void @main.prinsub(i64 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.prinsub"(i64 %0) { _llgo_0: %1 = sub i64 0, %0 - call void @main.printint(i64 %1) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printint"(i64 %1) ret void } -define void @main.printany(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printany"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 0 %2 = load ptr, ptr @_llgo_bool, align 8 @@ -321,7 +315,7 @@ _llgo_1: ; preds = %_llgo_34, %_llgo_85 ret void _llgo_2: ; preds = %_llgo_37 - call void @main.printbool(i1 %71) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printbool"(i1 %71) br label %_llgo_1 _llgo_3: ; preds = %_llgo_37 @@ -331,7 +325,7 @@ _llgo_3: ; preds = %_llgo_37 br i1 %6, label %_llgo_38, label %_llgo_39 _llgo_4: ; preds = %_llgo_40 - call void @main.printint(i64 %78) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printint"(i64 %78) br label %_llgo_1 _llgo_5: ; preds = %_llgo_40 @@ -342,7 +336,7 @@ _llgo_5: ; preds = %_llgo_40 _llgo_6: ; preds = %_llgo_43 %10 = sext i8 %86 to i64 - call void @main.printint(i64 %10) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printint"(i64 %10) br label %_llgo_1 _llgo_7: ; preds = %_llgo_43 @@ -353,7 +347,7 @@ _llgo_7: ; preds = %_llgo_43 _llgo_8: ; preds = %_llgo_46 %14 = sext i16 %94 to i64 - call void @main.printint(i64 %14) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printint"(i64 %14) br label %_llgo_1 _llgo_9: ; preds = %_llgo_46 @@ -364,7 +358,7 @@ _llgo_9: ; preds = %_llgo_46 _llgo_10: ; preds = %_llgo_49 %18 = sext i32 %102 to i64 - call void @main.printint(i64 %18) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printint"(i64 %18) br label %_llgo_1 _llgo_11: ; preds = %_llgo_49 @@ -374,7 +368,7 @@ _llgo_11: ; preds = %_llgo_49 br i1 %21, label %_llgo_50, label %_llgo_51 _llgo_12: ; preds = %_llgo_52 - call void @main.printint(i64 %109) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printint"(i64 %109) br label %_llgo_1 _llgo_13: ; preds = %_llgo_52 @@ -384,7 +378,7 @@ _llgo_13: ; preds = %_llgo_52 br i1 %24, label %_llgo_53, label %_llgo_54 _llgo_14: ; preds = %_llgo_55 - call void @main.printuint(i64 %116) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 %116) br label %_llgo_1 _llgo_15: ; preds = %_llgo_55 @@ -395,7 +389,7 @@ _llgo_15: ; preds = %_llgo_55 _llgo_16: ; preds = %_llgo_58 %28 = zext i8 %124 to i64 - call void @main.printuint(i64 %28) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 %28) br label %_llgo_1 _llgo_17: ; preds = %_llgo_58 @@ -406,7 +400,7 @@ _llgo_17: ; preds = %_llgo_58 _llgo_18: ; preds = %_llgo_61 %32 = zext i16 %132 to i64 - call void @main.printuint(i64 %32) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 %32) br label %_llgo_1 _llgo_19: ; preds = %_llgo_61 @@ -417,7 +411,7 @@ _llgo_19: ; preds = %_llgo_61 _llgo_20: ; preds = %_llgo_64 %36 = zext i32 %140 to i64 - call void @main.printuint(i64 %36) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 %36) br label %_llgo_1 _llgo_21: ; preds = %_llgo_64 @@ -427,7 +421,7 @@ _llgo_21: ; preds = %_llgo_64 br i1 %39, label %_llgo_65, label %_llgo_66 _llgo_22: ; preds = %_llgo_67 - call void @main.printuint(i64 %147) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 %147) br label %_llgo_1 _llgo_23: ; preds = %_llgo_67 @@ -437,7 +431,7 @@ _llgo_23: ; preds = %_llgo_67 br i1 %42, label %_llgo_68, label %_llgo_69 _llgo_24: ; preds = %_llgo_70 - call void @main.printuint(i64 %154) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 %154) br label %_llgo_1 _llgo_25: ; preds = %_llgo_70 @@ -448,7 +442,7 @@ _llgo_25: ; preds = %_llgo_70 _llgo_26: ; preds = %_llgo_73 %46 = fpext float %163 to double - call void @main.printfloat(double %46) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printfloat"(double %46) br label %_llgo_1 _llgo_27: ; preds = %_llgo_73 @@ -458,7 +452,7 @@ _llgo_27: ; preds = %_llgo_73 br i1 %49, label %_llgo_74, label %_llgo_75 _llgo_28: ; preds = %_llgo_76 - call void @main.printfloat(double %171) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printfloat"(double %171) br label %_llgo_1 _llgo_29: ; preds = %_llgo_76 @@ -468,14 +462,14 @@ _llgo_29: ; preds = %_llgo_76 br i1 %52, label %_llgo_77, label %_llgo_78 _llgo_30: ; preds = %_llgo_79 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }) %53 = extractvalue { float, float } %178, 0 %54 = fpext float %53 to double - call void @main.printfloat(double %54) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printfloat"(double %54) %55 = extractvalue { float, float } %178, 1 %56 = fpext float %55 to double - call void @main.printfloat(double %56) - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 2 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printfloat"(double %56) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 2 }) br label %_llgo_1 _llgo_31: ; preds = %_llgo_79 @@ -485,12 +479,12 @@ _llgo_31: ; preds = %_llgo_79 br i1 %59, label %_llgo_80, label %_llgo_81 _llgo_32: ; preds = %_llgo_82 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }) %60 = extractvalue { double, double } %185, 0 - call void @main.printfloat(double %60) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printfloat"(double %60) %61 = extractvalue { double, double } %185, 1 - call void @main.printfloat(double %61) - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 2 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printfloat"(double %61) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 2 }) br label %_llgo_1 _llgo_33: ; preds = %_llgo_82 @@ -500,7 +494,7 @@ _llgo_33: ; preds = %_llgo_82 br i1 %64, label %_llgo_83, label %_llgo_84 _llgo_34: ; preds = %_llgo_85 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" %192) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %192) br label %_llgo_1 _llgo_35: ; preds = %_llgo_0 @@ -786,33 +780,33 @@ _llgo_85: ; preds = %_llgo_84, %_llgo_83 br i1 %193, label %_llgo_34, label %_llgo_1 } -define void @main.printbool(i1 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printbool"(i1 %0) { _llgo_0: br i1 %0, label %_llgo_1, label %_llgo_3 _llgo_1: ; preds = %_llgo_0 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 4 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 4 }) br label %_llgo_2 _llgo_2: ; preds = %_llgo_3, %_llgo_1 ret void _llgo_3: ; preds = %_llgo_0 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 5 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 5 }) br label %_llgo_2 } -define void @main.printfloat(double %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printfloat"(double %0) { _llgo_0: %1 = fcmp une double %0, %0 br i1 %1, label %_llgo_1, label %_llgo_3 _llgo_1: ; preds = %_llgo_0 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 3 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 3 }) ret void _llgo_2: ; preds = %_llgo_7 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 4 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 4 }) ret void _llgo_3: ; preds = %_llgo_0 @@ -821,7 +815,7 @@ _llgo_3: ; preds = %_llgo_0 br i1 %3, label %_llgo_6, label %_llgo_7 _llgo_4: ; preds = %_llgo_10 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 4 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 4 }) ret void _llgo_5: ; preds = %_llgo_7 @@ -987,11 +981,11 @@ _llgo_29: ; preds = %_llgo_28, %_llgo_27 %78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %8, 0 %79 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %78, i64 14, 1 %80 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %79, i64 14, 2 - call void @main.gwrite(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %80) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.gwrite"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %80) ret void } -define void @main.printhex(i64 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printhex"(i64 %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 100) br label %_llgo_3 @@ -1027,7 +1021,7 @@ _llgo_2: ; preds = %_llgo_5, %_llgo_3 %20 = getelementptr inbounds i8, ptr %1, i64 %16 store i8 48, ptr %20, align 1 %21 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %1, i64 1, i64 100, i64 %16, i64 100, i64 100) - call void @main.gwrite(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %21) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.gwrite"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %21) ret void _llgo_3: ; preds = %_llgo_4, %_llgo_0 @@ -1043,28 +1037,28 @@ _llgo_4: ; preds = %_llgo_5, %_llgo_1 _llgo_5: ; preds = %_llgo_1 %27 = sub i64 100, %23 - %28 = load i64, ptr @main.minhexdigits, align 4 + %28 = load i64, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/print.minhexdigits", align 4 %29 = icmp sge i64 %27, %28 br i1 %29, label %_llgo_2, label %_llgo_4 } -define void @main.printint(i64 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printint"(i64 %0) { _llgo_0: %1 = icmp slt i64 %0, 0 br i1 %1, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 1 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 1 }) %2 = sub i64 0, %0 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 %3 = phi i64 [ %0, %_llgo_0 ], [ %2, %_llgo_1 ] - call void @main.printuint(i64 %3) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 %3) ret void } -define void @main.println(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.println"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, 1 br label %_llgo_1 @@ -1088,38 +1082,38 @@ _llgo_2: ; preds = %_llgo_1 br i1 %12, label %_llgo_4, label %_llgo_5 _llgo_3: ; preds = %_llgo_1 - call void @main.printnl() + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() ret void _llgo_4: ; preds = %_llgo_2 - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 1 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 1 }) br label %_llgo_5 _llgo_5: ; preds = %_llgo_4, %_llgo_2 - call void @main.printany(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %11) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printany"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %11) br label %_llgo_1 } -define void @main.printnl() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printnl"() { _llgo_0: - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 1 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 1 }) ret void } -define void @main.printsp() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printsp"() { _llgo_0: - call void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 1 }) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 1 }) ret void } -define void @main.printstring(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printstring"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { _llgo_0: - %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @main.bytes(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) - call void @main.gwrite(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) + %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testdata/print.bytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.gwrite"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) ret void } -define void @main.printuint(i64 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 100) br label %_llgo_3 @@ -1139,7 +1133,7 @@ _llgo_1: ; preds = %_llgo_3 _llgo_2: ; preds = %_llgo_1, %_llgo_3 %10 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %1, i64 1, i64 100, i64 %12, i64 100, i64 100) - call void @main.gwrite(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.gwrite"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10) ret void _llgo_3: ; preds = %_llgo_4, %_llgo_0 @@ -1154,21 +1148,21 @@ _llgo_4: ; preds = %_llgo_1 br label %_llgo_3 } -define void @main.prinusub(i64 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.prinusub"(i64 %0) { _llgo_0: %1 = sub i64 0, %0 - call void @main.printuint(i64 %1) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printuint"(i64 %1) ret void } -define void @main.prinxor(i64 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.prinxor"(i64 %0) { _llgo_0: %1 = xor i64 %0, -1 - call void @main.printint(i64 %1) + call void @"github.com/goplus/llgo/compiler/cl/_testdata/print.printint"(i64 %1) ret void } -define ptr @main.stringStructOf(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testdata/print.stringStructOf"(ptr %0) { _llgo_0: ret ptr %0 } @@ -1179,9 +1173,7 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange" declare i32 @printf(ptr, ...) -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/print.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_float32, align 8 %1 = icmp eq ptr %0, null diff --git a/compiler/cl/_testdata/printf/out.ll b/compiler/cl/_testdata/printf/out.ll index a1d05cf6..57cea162 100644 --- a/compiler/cl/_testdata/printf/out.ll +++ b/compiler/cl/_testdata/printf/out.ll @@ -1,41 +1,33 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/printf' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/printf" -@main.hello = global [7 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/printf.hello" = global [7 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testdata/printf.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/printf.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.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 - store i8 72, ptr @main.hello, align 1 - store i8 101, ptr getelementptr inbounds (i8, ptr @main.hello, i64 1), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.hello, i64 2), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.hello, i64 3), align 1 - store i8 111, ptr getelementptr inbounds (i8, ptr @main.hello, i64 4), align 1 - store i8 10, ptr getelementptr inbounds (i8, ptr @main.hello, i64 5), align 1 - store i8 0, ptr getelementptr inbounds (i8, ptr @main.hello, i64 6), align 1 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.init$guard", align 1 + store i8 72, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.hello", align 1 + store i8 101, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.hello", i64 1), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.hello", i64 2), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.hello", i64 3), align 1 + store i8 111, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.hello", i64 4), align 1 + store i8 10, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.hello", i64 5), align 1 + store i8 0, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.hello", i64 6), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/printf.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void (ptr, ...) @printf(ptr @main.hello) - ret i32 0 + call void (ptr, ...) @printf(ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printf.hello") + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @printf(ptr, ...) diff --git a/compiler/cl/_testdata/printval/out.ll b/compiler/cl/_testdata/printval/out.ll index 156a2980..6e9d3fdf 100644 --- a/compiler/cl/_testdata/printval/out.ll +++ b/compiler/cl/_testdata/printval/out.ll @@ -1,44 +1,36 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/printval' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/printval" -@main.format = global [10 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/printval.format" = global [10 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testdata/printval.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/printval.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.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 - store i8 72, ptr @main.format, align 1 - store i8 101, ptr getelementptr inbounds (i8, ptr @main.format, i64 1), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 2), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 3), align 1 - store i8 111, ptr getelementptr inbounds (i8, ptr @main.format, i64 4), align 1 - store i8 32, ptr getelementptr inbounds (i8, ptr @main.format, i64 5), align 1 - store i8 37, ptr getelementptr inbounds (i8, ptr @main.format, i64 6), align 1 - store i8 100, ptr getelementptr inbounds (i8, ptr @main.format, i64 7), align 1 - store i8 10, ptr getelementptr inbounds (i8, ptr @main.format, i64 8), align 1 - store i8 0, ptr getelementptr inbounds (i8, ptr @main.format, i64 9), align 1 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.init$guard", align 1 + store i8 72, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", align 1 + store i8 101, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 1), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 2), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 3), align 1 + store i8 111, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 4), align 1 + store i8 32, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 5), align 1 + store i8 37, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 6), align 1 + store i8 100, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 7), align 1 + store i8 10, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 8), align 1 + store i8 0, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 9), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/printval.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void (ptr, ...) @printf(ptr @main.format, i64 100) - ret i32 0 + call void (ptr, ...) @printf(ptr @"github.com/goplus/llgo/compiler/cl/_testdata/printval.format", i64 100) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @printf(ptr, ...) diff --git a/compiler/cl/_testdata/ptrmthd/out.ll b/compiler/cl/_testdata/ptrmthd/out.ll index 3e80604e..4bb08098 100644 --- a/compiler/cl/_testdata/ptrmthd/out.ll +++ b/compiler/cl/_testdata/ptrmthd/out.ll @@ -1,50 +1,42 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd" -@main.format = global [10 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format" = global [10 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.init$guard" = global i1 false, align 1 -define void @"main.(*T).Print"(ptr %0, i64 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.(*T).Print"(ptr %0, i64 %1) { _llgo_0: call void (ptr, ...) @printf(ptr %0, i64 %1) ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.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 - store i8 72, ptr @main.format, align 1 - store i8 101, ptr getelementptr inbounds (i8, ptr @main.format, i64 1), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 2), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 3), align 1 - store i8 111, ptr getelementptr inbounds (i8, ptr @main.format, i64 4), align 1 - store i8 32, ptr getelementptr inbounds (i8, ptr @main.format, i64 5), align 1 - store i8 37, ptr getelementptr inbounds (i8, ptr @main.format, i64 6), align 1 - store i8 100, ptr getelementptr inbounds (i8, ptr @main.format, i64 7), align 1 - store i8 10, ptr getelementptr inbounds (i8, ptr @main.format, i64 8), align 1 - store i8 0, ptr getelementptr inbounds (i8, ptr @main.format, i64 9), align 1 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.init$guard", align 1 + store i8 72, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", align 1 + store i8 101, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 1), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 2), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 3), align 1 + store i8 111, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 4), align 1 + store i8 32, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 5), align 1 + store i8 37, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 6), align 1 + store i8 100, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 7), align 1 + store i8 10, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 8), align 1 + store i8 0, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 9), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @"main.(*T).Print"(ptr @main.format, i64 100) - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.(*T).Print"(ptr @"github.com/goplus/llgo/compiler/cl/_testdata/ptrmthd.format", i64 100) + ret void } declare void @printf(ptr, ...) - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testdata/uint/out.ll b/compiler/cl/_testdata/uint/out.ll index 0e51cc82..09ff1edf 100644 --- a/compiler/cl/_testdata/uint/out.ll +++ b/compiler/cl/_testdata/uint/out.ll @@ -1,41 +1,33 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/uint' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/uint" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/uint.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [11 x i8] c"Hello, %u\0A\00", align 1 -define i32 @main.f(i32 %0) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testdata/uint.f"(i32 %0) { _llgo_0: %1 = add i32 %0, 1 ret i32 %1 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/uint.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/uint.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/uint.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/uint.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call i32 @main.f(i32 100) - %3 = call i32 (ptr, ...) @printf(ptr @0, i32 %2) - ret i32 0 + %0 = call i32 @"github.com/goplus/llgo/compiler/cl/_testdata/uint.f"(i32 100) + %1 = call i32 (ptr, ...) @printf(ptr @0, i32 %0) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testdata/untyped/out.ll b/compiler/cl/_testdata/untyped/out.ll index 2cd3e107..90fc88a5 100644 --- a/compiler/cl/_testdata/untyped/out.ll +++ b/compiler/cl/_testdata/untyped/out.ll @@ -1,39 +1,31 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/untyped' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/untyped" -@main.a = global double 0.000000e+00, align 8 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/untyped.a" = global double 0.000000e+00, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/untyped.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/untyped.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/untyped.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 - store double 1.000000e+00, ptr @main.a, align 8 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/untyped.init$guard", align 1 + store double 1.000000e+00, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/untyped.a", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/untyped.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() br i1 false, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store double 0.000000e+00, ptr @main.a, align 8 + store double 0.000000e+00, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/untyped.a", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 - ret i32 0 + ret void } - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testdata/utf8/out.ll b/compiler/cl/_testdata/utf8/out.ll index 8e0421f7..c611bff2 100644 --- a/compiler/cl/_testdata/utf8/out.ll +++ b/compiler/cl/_testdata/utf8/out.ll @@ -1,86 +1,78 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/utf8' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/utf8" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@main.array = global [8 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array" = global [8 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testdata/utf8.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [7 x i8] c"\E4\B8\ADabcd", align 1 -define i8 @main.index(i8 %0) { +define i8 @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.index"(i8 %0) { _llgo_0: %1 = sext i8 %0 to i64 %2 = icmp slt i64 %1, 0 %3 = icmp sge i64 %1, 8 %4 = or i1 %3, %2 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %4) - %5 = getelementptr inbounds i8, ptr @main.array, i64 %1 + %5 = getelementptr inbounds i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array", i64 %1 %6 = load i8, ptr %5, align 1 ret i8 %6 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.init$guard", align 1 call void @"unicode/utf8.init"() - store i8 1, ptr @main.array, align 1 - store i8 2, ptr getelementptr inbounds (i8, ptr @main.array, i64 1), align 1 - store i8 3, ptr getelementptr inbounds (i8, ptr @main.array, i64 2), align 1 - store i8 4, ptr getelementptr inbounds (i8, ptr @main.array, i64 3), align 1 - store i8 5, ptr getelementptr inbounds (i8, ptr @main.array, i64 4), align 1 - store i8 6, ptr getelementptr inbounds (i8, ptr @main.array, i64 5), align 1 - store i8 7, ptr getelementptr inbounds (i8, ptr @main.array, i64 6), align 1 - store i8 8, ptr getelementptr inbounds (i8, ptr @main.array, i64 7), align 1 + store i8 1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array", align 1 + store i8 2, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array", i64 1), align 1 + store i8 3, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array", i64 2), align 1 + store i8 4, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array", i64 3), align 1 + store i8 5, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array", i64 4), align 1 + store i8 6, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array", i64 5), align 1 + store i8 7, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array", i64 6), align 1 + store i8 8, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.array", i64 7), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() br label %_llgo_1 _llgo_1: ; preds = %_llgo_2, %_llgo_0 - %2 = phi i64 [ 0, %_llgo_0 ], [ %8, %_llgo_2 ] - %3 = icmp slt i64 %2, 7 - br i1 %3, label %_llgo_2, label %_llgo_3 + %0 = phi i64 [ 0, %_llgo_0 ], [ %6, %_llgo_2 ] + %1 = icmp slt i64 %0, 7 + br i1 %1, label %_llgo_2, label %_llgo_3 _llgo_2: ; preds = %_llgo_1 - %4 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 7 }, i64 %2, i64 7) - %5 = call { i32, i64 } @"unicode/utf8.DecodeRuneInString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %4) - %6 = extractvalue { i32, i64 } %5, 0 - %7 = extractvalue { i32, i64 } %5, 1 - %8 = add i64 %2, %7 - %9 = sext i32 %6 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %9) + %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 7 }, i64 %0, i64 7) + %3 = call { i32, i64 } @"unicode/utf8.DecodeRuneInString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %2) + %4 = extractvalue { i32, i64 } %3, 0 + %5 = extractvalue { i32, i64 } %3, 1 + %6 = add i64 %0, %5 + %7 = sext i32 %4 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %7) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) br label %_llgo_1 _llgo_3: ; preds = %_llgo_1 - %10 = call i8 @main.index(i8 2) - %11 = icmp eq i8 %10, 3 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %11) + %8 = call i8 @"github.com/goplus/llgo/compiler/cl/_testdata/utf8.index"(i8 2) + %9 = icmp eq i8 %8, 3 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %9) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1) declare void @"unicode/utf8.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String", i64, i64) declare { i32, i64 } @"unicode/utf8.DecodeRuneInString"(%"github.com/goplus/llgo/runtime/internal/runtime.String") diff --git a/compiler/cl/_testdata/vargs/out.ll b/compiler/cl/_testdata/vargs/out.ll index 056085d9..70b0b30f 100644 --- a/compiler/cl/_testdata/vargs/out.ll +++ b/compiler/cl/_testdata/vargs/out.ll @@ -1,62 +1,56 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/vargs' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/vargs" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/vargs.init$guard" = global i1 false, align 1 @_llgo_int = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @1 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 @_llgo_string = linkonce global ptr null, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/vargs.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/vargs.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/vargs.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/vargs.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/vargs.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48) - %3 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %2, i64 0 - %4 = load ptr, ptr @_llgo_int, align 8 - %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 - %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr inttoptr (i64 1 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr %3, align 8 - %7 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %2, i64 1 - %8 = load ptr, ptr @_llgo_int, align 8 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %8, 0 - %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, ptr inttoptr (i64 2 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, ptr %7, align 8 - %11 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %2, i64 2 - %12 = load ptr, ptr @_llgo_int, align 8 - %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %12, 0 - %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, ptr inttoptr (i64 3 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %14, ptr %11, align 8 - %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0 - %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %15, i64 3, 1 - %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16, i64 3, 2 - call void @main.test(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17) - ret i32 0 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48) + %1 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %0, i64 0 + %2 = load ptr, ptr @_llgo_int, align 8 + %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 + %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, ptr inttoptr (i64 1 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %4, ptr %1, align 8 + %5 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %0, i64 1 + %6 = load ptr, ptr @_llgo_int, align 8 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %6, 0 + %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr inttoptr (i64 2 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, ptr %5, align 8 + %9 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %0, i64 2 + %10 = load ptr, ptr @_llgo_int, align 8 + %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %10, 0 + %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %11, ptr inttoptr (i64 3 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %12, ptr %9, align 8 + %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0 + %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %13, i64 3, 1 + %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %14, i64 3, 2 + call void @"github.com/goplus/llgo/compiler/cl/_testdata/vargs.test"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %15) + ret void } -define void @main.test(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/vargs.test"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, 1 br label %_llgo_1 @@ -100,11 +94,9 @@ _llgo_5: ; preds = %_llgo_2 unreachable } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/vargs.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = icmp eq ptr %0, null diff --git a/compiler/cl/_testdata/varinit/out.ll b/compiler/cl/_testdata/varinit/out.ll index 38757509..c86f6f42 100644 --- a/compiler/cl/_testdata/varinit/out.ll +++ b/compiler/cl/_testdata/varinit/out.ll @@ -1,36 +1,28 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/varinit' +source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/varinit" -@main.a = global i64 0, align 8 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/varinit.a" = global i64 0, align 8 +@"github.com/goplus/llgo/compiler/cl/_testdata/varinit.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/varinit.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/varinit.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 - store i64 100, ptr @main.a, align 4 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/varinit.init$guard", align 1 + store i64 100, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/varinit.a", align 4 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testdata/varinit.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load i64, ptr @main.a, align 4 - %3 = add i64 %2, 1 - store i64 %3, ptr @main.a, align 4 - %4 = load i64, ptr @main.a, align 4 - ret i32 0 + %0 = load i64, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/varinit.a", align 4 + %1 = add i64 %0, 1 + store i64 %1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/varinit.a", align 4 + %2 = load i64, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/varinit.a", align 4 + ret void } - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testgo/allocinloop/out.ll b/compiler/cl/_testgo/allocinloop/out.ll index c82eed69..39b84701 100644 --- a/compiler/cl/_testgo/allocinloop/out.ll +++ b/compiler/cl/_testgo/allocinloop/out.ll @@ -1,20 +1,18 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/allocinloop' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/allocinloop" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/allocinloop.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [5 x i8] c"hello", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -define i64 @main.Foo(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/allocinloop.Foo"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %0, 1 ret i64 %1 } -define void @main.Test() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/allocinloop.Test"() { _llgo_0: br label %_llgo_1 @@ -25,7 +23,7 @@ _llgo_1: ; preds = %_llgo_2, %_llgo_0 br i1 %2, label %_llgo_2, label %_llgo_3 _llgo_2: ; preds = %_llgo_1 - %3 = call i64 @main.Foo(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }) + %3 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/allocinloop.Foo"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }) %4 = add i64 %0, %3 %5 = add i64 %1, 1 br label %_llgo_1 @@ -36,31 +34,25 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/allocinloop.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/allocinloop.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/allocinloop.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/allocinloop.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.Test() - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/allocinloop.Test"() + ret void } declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testgo/cgobasic/out.ll b/compiler/cl/_testgo/cgobasic/out.ll index 5df5a10d..f0eb4c1a 100644 --- a/compiler/cl/_testgo/cgobasic/out.ll +++ b/compiler/cl/_testgo/cgobasic/out.ll @@ -1,5 +1,5 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/cgobasic' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/cgobasic" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } @@ -14,16 +14,14 @@ source_filename = "main" @_cgo_217b74f897b2_Cfunc_puts = external global i8, align 1 @_cgo_217b74f897b2_Cfunc_sin = external global i8, align 1 @_cgo_217b74f897b2_Cfunc_sqrt = external global i8, align 1 -@main._cgo_217b74f897b2_Cfunc__Cmalloc = global ptr null, align 8 -@main._cgo_217b74f897b2_Cfunc_cos = global ptr null, align 8 -@main._cgo_217b74f897b2_Cfunc_free = global ptr null, align 8 -@main._cgo_217b74f897b2_Cfunc_log = global ptr null, align 8 -@main._cgo_217b74f897b2_Cfunc_puts = global ptr null, align 8 -@main._cgo_217b74f897b2_Cfunc_sin = global ptr null, align 8 -@main._cgo_217b74f897b2_Cfunc_sqrt = global ptr null, align 8 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc__Cmalloc" = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_cos" = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_free" = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_log" = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_puts" = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_sin" = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_sqrt" = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [13 x i8] c"Hello, World!", align 1 @1 = private unnamed_addr constant [29 x i8] c"Converted back to Go string: ", align 1 @2 = private unnamed_addr constant [23 x i8] c"Length-limited string: ", align 1 @@ -37,239 +35,235 @@ source_filename = "main" @"[]_llgo_byte" = linkonce global ptr null, align 8 @_llgo_Pointer = linkonce global ptr null, align 8 -define double @main._Cfunc_cos(double %0) { +define double @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_cos"(double %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %2 = load ptr, ptr @main._cgo_217b74f897b2_Cfunc_cos, align 8 + %2 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_cos", align 8 %3 = load ptr, ptr %2, align 8 %4 = call double %3(double %0) ret double %4 } -define [0 x i8] @main._Cfunc_free(ptr %0) { +define [0 x i8] @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_free"(ptr %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %2 = load ptr, ptr @main._cgo_217b74f897b2_Cfunc_free, align 8 + %2 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_free", align 8 %3 = load ptr, ptr %2, align 8 %4 = call [0 x i8] %3(ptr %0) ret [0 x i8] %4 } -define double @main._Cfunc_log(double %0) { +define double @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_log"(double %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %2 = load ptr, ptr @main._cgo_217b74f897b2_Cfunc_log, align 8 + %2 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_log", align 8 %3 = load ptr, ptr %2, align 8 %4 = call double %3(double %0) ret double %4 } -define i32 @main._Cfunc_puts(ptr %0) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_puts"(ptr %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %2 = load ptr, ptr @main._cgo_217b74f897b2_Cfunc_puts, align 8 + %2 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_puts", align 8 %3 = load ptr, ptr %2, align 8 %4 = call i32 %3(ptr %0) ret i32 %4 } -define double @main._Cfunc_sin(double %0) { +define double @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_sin"(double %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %2 = load ptr, ptr @main._cgo_217b74f897b2_Cfunc_sin, align 8 + %2 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_sin", align 8 %3 = load ptr, ptr %2, align 8 %4 = call double %3(double %0) ret double %4 } -define double @main._Cfunc_sqrt(double %0) { +define double @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_sqrt"(double %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %2 = load ptr, ptr @main._cgo_217b74f897b2_Cfunc_sqrt, align 8 + %2 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_sqrt", align 8 %3 = load ptr, ptr %2, align 8 %4 = call double %3(double %0) ret double %4 } -define ptr @main._Cgo_ptr(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cgo_ptr"(ptr %0) { _llgo_0: ret ptr %0 } declare void @runtime.cgoUse(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -declare void @main._cgoCheckResult(%"github.com/goplus/llgo/runtime/internal/runtime.eface") +declare void @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgoCheckResult"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.init$guard", align 1 call void @syscall.init() call void @fmt.init() - call void @"main.init$after"() - store ptr @_cgo_217b74f897b2_Cfunc_cos, ptr @main._cgo_217b74f897b2_Cfunc_cos, align 8 - store ptr @_cgo_217b74f897b2_Cfunc_free, ptr @main._cgo_217b74f897b2_Cfunc_free, align 8 - store ptr @_cgo_217b74f897b2_Cfunc_log, ptr @main._cgo_217b74f897b2_Cfunc_log, align 8 - store ptr @_cgo_217b74f897b2_Cfunc_puts, ptr @main._cgo_217b74f897b2_Cfunc_puts, align 8 - store ptr @_cgo_217b74f897b2_Cfunc_sin, ptr @main._cgo_217b74f897b2_Cfunc_sin, align 8 - store ptr @_cgo_217b74f897b2_Cfunc_sqrt, ptr @main._cgo_217b74f897b2_Cfunc_sqrt, align 8 - store ptr @_cgo_217b74f897b2_Cfunc__Cmalloc, ptr @main._cgo_217b74f897b2_Cfunc__Cmalloc, align 8 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.init$after"() + store ptr @_cgo_217b74f897b2_Cfunc_cos, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_cos", align 8 + store ptr @_cgo_217b74f897b2_Cfunc_free, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_free", align 8 + store ptr @_cgo_217b74f897b2_Cfunc_log, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_log", align 8 + store ptr @_cgo_217b74f897b2_Cfunc_puts, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_puts", align 8 + store ptr @_cgo_217b74f897b2_Cfunc_sin, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_sin", align 8 + store ptr @_cgo_217b74f897b2_Cfunc_sqrt, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc_sqrt", align 8 + store ptr @_cgo_217b74f897b2_Cfunc__Cmalloc, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._cgo_217b74f897b2_Cfunc__Cmalloc", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.CString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 13 }) - store ptr %3, ptr %2, align 8 - %4 = load ptr, ptr %2, align 8 - %5 = call i32 @main._Cfunc_puts(ptr %4) - %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) - %8 = getelementptr inbounds i8, ptr %7, i64 0 - store i8 65, ptr %8, align 1 - %9 = getelementptr inbounds i8, ptr %7, i64 1 - store i8 66, ptr %9, align 1 - %10 = getelementptr inbounds i8, ptr %7, i64 2 - store i8 67, ptr %10, align 1 - %11 = getelementptr inbounds i8, ptr %7, i64 3 - store i8 68, ptr %11, align 1 - %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %7, 0 - %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %12, i64 4, 1 - %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %13, i64 4, 2 - store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %14, ptr %6, align 8 - %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %16 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %17 = getelementptr inbounds { ptr }, ptr %16, i32 0, i32 0 - store ptr %6, ptr %17, align 8 - %18 = insertvalue { ptr, ptr } { ptr @"main.main$1", ptr undef }, ptr %16, 1 - %19 = extractvalue { ptr, ptr } %18, 1 - %20 = extractvalue { ptr, ptr } %18, 0 - %21 = call ptr %20(ptr %19) - store ptr %21, ptr %15, align 8 - %22 = load ptr, ptr %2, align 8 - %23 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.GoString"(ptr %22) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.CString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 13 }) + store ptr %1, ptr %0, align 8 + %2 = load ptr, ptr %0, align 8 + %3 = call i32 @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_puts"(ptr %2) + %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) + %6 = getelementptr inbounds i8, ptr %5, i64 0 + store i8 65, ptr %6, align 1 + %7 = getelementptr inbounds i8, ptr %5, i64 1 + store i8 66, ptr %7, align 1 + %8 = getelementptr inbounds i8, ptr %5, i64 2 + store i8 67, ptr %8, align 1 + %9 = getelementptr inbounds i8, ptr %5, i64 3 + store i8 68, ptr %9, align 1 + %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %5, 0 + %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10, i64 4, 1 + %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %11, i64 4, 2 + store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %12, ptr %4, align 8 + %13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %15 = getelementptr inbounds { ptr }, ptr %14, i32 0, i32 0 + store ptr %4, ptr %15, align 8 + %16 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.main$1", ptr undef }, ptr %14, 1 + %17 = extractvalue { ptr, ptr } %16, 1 + %18 = extractvalue { ptr, ptr } %16, 0 + %19 = call ptr %18(ptr %17) + store ptr %19, ptr %13, align 8 + %20 = load ptr, ptr %0, align 8 + %21 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.GoString"(ptr %20) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 29 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %21) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) + %22 = load ptr, ptr %0, align 8 + %23 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.GoStringN"(ptr %22, i32 5) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 23 }) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %23) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %24 = load ptr, ptr %2, align 8 - %25 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.GoStringN"(ptr %24, i32 5) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 23 }) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %25) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %26 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %27 = getelementptr inbounds { ptr }, ptr %26, i32 0, i32 0 - store ptr %15, ptr %27, align 8 - %28 = insertvalue { ptr, ptr } { ptr @"main.main$2", ptr undef }, ptr %26, 1 - %29 = extractvalue { ptr, ptr } %28, 1 - %30 = extractvalue { ptr, ptr } %28, 0 - %31 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30(ptr %29) + %24 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %25 = getelementptr inbounds { ptr }, ptr %24, i32 0, i32 0 + store ptr %13, ptr %25, align 8 + %26 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.main$2", ptr undef }, ptr %24, 1 + %27 = extractvalue { ptr, ptr } %26, 1 + %28 = extractvalue { ptr, ptr } %26, 0 + %29 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28(ptr %27) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 33 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %32 = call double @main._Cfunc_sqrt(double 2.000000e+00) - %33 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %34 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %33, i64 0 - %35 = load ptr, ptr @_llgo_float64, align 8 - %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %35, 0 - %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %36, ptr inttoptr (i64 4611686018427387904 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %37, ptr %34, align 8 - %38 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %33, i64 1 - %39 = load ptr, ptr @_llgo_float64, align 8 - %40 = bitcast double %32 to i64 - %41 = inttoptr i64 %40 to ptr - %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %39, 0 - %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %42, ptr %41, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %43, ptr %38, align 8 - %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %33, 0 - %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %44, i64 2, 1 - %46 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %45, i64 2, 2 - %47 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Printf(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 14 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %46) - %48 = call double @main._Cfunc_sin(double 2.000000e+00) - %49 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %50 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %49, i64 0 - %51 = load ptr, ptr @_llgo_float64, align 8 - %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %51, 0 - %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %52, ptr inttoptr (i64 4611686018427387904 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %53, ptr %50, align 8 - %54 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %49, i64 1 - %55 = load ptr, ptr @_llgo_float64, align 8 - %56 = bitcast double %48 to i64 - %57 = inttoptr i64 %56 to ptr - %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %55, 0 - %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %58, ptr %57, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %59, ptr %54, align 8 - %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %49, 0 - %61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, i64 2, 1 - %62 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61, i64 2, 2 - %63 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Printf(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 13 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %62) - %64 = call double @main._Cfunc_cos(double 2.000000e+00) - %65 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %66 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %65, i64 0 - %67 = load ptr, ptr @_llgo_float64, align 8 - %68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %67, 0 - %69 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %68, ptr inttoptr (i64 4611686018427387904 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %69, ptr %66, align 8 - %70 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %65, i64 1 - %71 = load ptr, ptr @_llgo_float64, align 8 - %72 = bitcast double %64 to i64 - %73 = inttoptr i64 %72 to ptr - %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %71, 0 - %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %74, ptr %73, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %75, ptr %70, align 8 - %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %65, 0 - %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76, i64 2, 1 - %78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77, i64 2, 2 - %79 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Printf(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 13 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %78) - %80 = call double @main._Cfunc_log(double 2.000000e+00) - %81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %82 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %81, i64 0 - %83 = load ptr, ptr @_llgo_float64, align 8 - %84 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %83, 0 - %85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %84, ptr inttoptr (i64 4611686018427387904 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %85, ptr %82, align 8 - %86 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %81, i64 1 - %87 = load ptr, ptr @_llgo_float64, align 8 - %88 = bitcast double %80 to i64 - %89 = inttoptr i64 %88 to ptr - %90 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %87, 0 - %91 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %90, ptr %89, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %91, ptr %86, align 8 - %92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %81, 0 - %93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %92, i64 2, 1 - %94 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %93, i64 2, 2 - %95 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Printf(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 13 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %94) - %96 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %97 = getelementptr inbounds { ptr }, ptr %96, i32 0, i32 0 - store ptr %2, ptr %97, align 8 - %98 = insertvalue { ptr, ptr } { ptr @"main.main$3", ptr undef }, ptr %96, 1 - %99 = extractvalue { ptr, ptr } %98, 1 - %100 = extractvalue { ptr, ptr } %98, 0 - call void %100(ptr %99) - %101 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %102 = getelementptr inbounds { ptr }, ptr %101, i32 0, i32 0 - store ptr %15, ptr %102, align 8 - %103 = insertvalue { ptr, ptr } { ptr @"main.main$4", ptr undef }, ptr %101, 1 - %104 = extractvalue { ptr, ptr } %103, 1 - %105 = extractvalue { ptr, ptr } %103, 0 - call void %105(ptr %104) - ret i32 0 + %30 = call double @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_sqrt"(double 2.000000e+00) + %31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %32 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %31, i64 0 + %33 = load ptr, ptr @_llgo_float64, align 8 + %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %33, 0 + %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %34, ptr inttoptr (i64 4611686018427387904 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %35, ptr %32, align 8 + %36 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %31, i64 1 + %37 = load ptr, ptr @_llgo_float64, align 8 + %38 = bitcast double %30 to i64 + %39 = inttoptr i64 %38 to ptr + %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %37, 0 + %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %40, ptr %39, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %41, ptr %36, align 8 + %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %31, 0 + %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %42, i64 2, 1 + %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %43, i64 2, 2 + %45 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Printf(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 14 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %44) + %46 = call double @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_sin"(double 2.000000e+00) + %47 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %48 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %47, i64 0 + %49 = load ptr, ptr @_llgo_float64, align 8 + %50 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %49, 0 + %51 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %50, ptr inttoptr (i64 4611686018427387904 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %51, ptr %48, align 8 + %52 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %47, i64 1 + %53 = load ptr, ptr @_llgo_float64, align 8 + %54 = bitcast double %46 to i64 + %55 = inttoptr i64 %54 to ptr + %56 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %53, 0 + %57 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %56, ptr %55, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %57, ptr %52, align 8 + %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %47, 0 + %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, i64 2, 1 + %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59, i64 2, 2 + %61 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Printf(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 13 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60) + %62 = call double @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_cos"(double 2.000000e+00) + %63 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %64 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %63, i64 0 + %65 = load ptr, ptr @_llgo_float64, align 8 + %66 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %65, 0 + %67 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %66, ptr inttoptr (i64 4611686018427387904 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %67, ptr %64, align 8 + %68 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %63, i64 1 + %69 = load ptr, ptr @_llgo_float64, align 8 + %70 = bitcast double %62 to i64 + %71 = inttoptr i64 %70 to ptr + %72 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %69, 0 + %73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %72, ptr %71, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %73, ptr %68, align 8 + %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %63, 0 + %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %74, i64 2, 1 + %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75, i64 2, 2 + %77 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Printf(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 13 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76) + %78 = call double @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_log"(double 2.000000e+00) + %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %80 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %79, i64 0 + %81 = load ptr, ptr @_llgo_float64, align 8 + %82 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %81, 0 + %83 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %82, ptr inttoptr (i64 4611686018427387904 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %83, ptr %80, align 8 + %84 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %79, i64 1 + %85 = load ptr, ptr @_llgo_float64, align 8 + %86 = bitcast double %78 to i64 + %87 = inttoptr i64 %86 to ptr + %88 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %85, 0 + %89 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %88, ptr %87, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %89, ptr %84, align 8 + %90 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %79, 0 + %91 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %90, i64 2, 1 + %92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %91, i64 2, 2 + %93 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Printf(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 13 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %92) + %94 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %95 = getelementptr inbounds { ptr }, ptr %94, i32 0, i32 0 + store ptr %0, ptr %95, align 8 + %96 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.main$3", ptr undef }, ptr %94, 1 + %97 = extractvalue { ptr, ptr } %96, 1 + %98 = extractvalue { ptr, ptr } %96, 0 + call void %98(ptr %97) + %99 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %100 = getelementptr inbounds { ptr }, ptr %99, i32 0, i32 0 + store ptr %13, ptr %100, align 8 + %101 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.main$4", ptr undef }, ptr %99, 1 + %102 = extractvalue { ptr, ptr } %101, 1 + %103 = extractvalue { ptr, ptr } %101, 0 + call void %103(ptr %102) + ret void } -define ptr @"main.main$1"(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.main$1"(ptr %0) { _llgo_0: %1 = load { ptr }, ptr %0, align 8 %2 = extractvalue { ptr } %1, 0 @@ -284,7 +278,7 @@ _llgo_0: ret ptr %9 } -define %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"main.main$2"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.main$2"(ptr %0) { _llgo_0: %1 = load { ptr }, ptr %0, align 8 %2 = extractvalue { ptr } %1, 0 @@ -296,7 +290,7 @@ _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7 } -define void @"main.main$3"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.main$3"(ptr %0) { _llgo_0: %1 = load { ptr }, ptr %0, align 8 %2 = extractvalue { ptr } %1, 0 @@ -304,11 +298,11 @@ _llgo_0: %4 = load ptr, ptr @_llgo_Pointer, align 8 %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr %3, 1 - %7 = call [0 x i8] @main._Cfunc_free(ptr %3) + %7 = call [0 x i8] @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_free"(ptr %3) ret void } -define void @"main.main$4"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.main$4"(ptr %0) { _llgo_0: %1 = load { ptr }, ptr %0, align 8 %2 = extractvalue { ptr } %1, 0 @@ -316,7 +310,7 @@ _llgo_0: %4 = load ptr, ptr @_llgo_Pointer, align 8 %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr %3, 1 - %7 = call [0 x i8] @main._Cfunc_free(ptr %3) + %7 = call [0 x i8] @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic._Cfunc_free"(ptr %3) ret void } @@ -328,8 +322,6 @@ declare void @syscall.init() declare void @fmt.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.CString"(%"github.com/goplus/llgo/runtime/internal/runtime.String") declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) @@ -344,7 +336,7 @@ declare %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/g declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice") -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/cgobasic.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_float64, align 8 %1 = icmp eq ptr %0, null diff --git a/compiler/cl/_testgo/cgocfiles/out.ll b/compiler/cl/_testgo/cgocfiles/out.ll index 536c460d..9c83d5a9 100644 --- a/compiler/cl/_testgo/cgocfiles/out.ll +++ b/compiler/cl/_testgo/cgocfiles/out.ll @@ -1,132 +1,126 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -%main._Ctype_struct___3 = type { i32 } -%main._Ctype_struct___4 = type { i32, i32 } -%main._Ctype_struct___0 = type { i32, i32, i32 } -%main._Ctype_struct___1 = type { i32, i32, i32, i32 } -%main._Ctype_struct___2 = type { i32, i32, i32, i32, i32 } +%"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___3" = type { i32 } +%"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___4" = type { i32, i32 } +%"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___0" = type { i32, i32, i32 } +%"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___1" = type { i32, i32, i32, i32 } +%"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___2" = type { i32, i32, i32, i32, i32 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } @"github.com/goplus/llgo/runtime/internal/runtime.cgoAlwaysFalse" = external global i1, align 1 @_cgo_023ff89410ef_Cfunc_test_structs = external global i8, align 1 -@main._cgo_023ff89410ef_Cfunc_test_structs = global ptr null, align 8 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -@_llgo_main._Ctype_int = linkonce global ptr null, align 8 -@0 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._cgo_023ff89410ef_Cfunc_test_structs" = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles.init$guard" = global i1 false, align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_int" = linkonce global ptr null, align 8 +@0 = private unnamed_addr constant [52 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles", align 1 @1 = private unnamed_addr constant [10 x i8] c"_Ctype_int", align 1 @_llgo_int32 = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [19 x i8] c"test_structs failed", align 1 @_llgo_string = linkonce global ptr null, align 8 -define i32 @main._Cfunc_test_structs(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Cfunc_test_structs"(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4) { _llgo_0: %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %6 = load ptr, ptr @main._cgo_023ff89410ef_Cfunc_test_structs, align 8 + %6 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._cgo_023ff89410ef_Cfunc_test_structs", align 8 %7 = load ptr, ptr %6, align 8 %8 = call i32 %7(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4) ret i32 %8 } -define ptr @main._Cgo_ptr(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Cgo_ptr"(ptr %0) { _llgo_0: ret ptr %0 } declare void @runtime.cgoUse(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -declare void @main._cgoCheckResult(%"github.com/goplus/llgo/runtime/internal/runtime.eface") +declare void @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._cgoCheckResult"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles.init$guard", align 1 call void @syscall.init() call void @fmt.init() - call void @"main.init$after"() - store ptr @_cgo_023ff89410ef_Cfunc_test_structs, ptr @main._cgo_023ff89410ef_Cfunc_test_structs, align 8 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles.init$after"() + store ptr @_cgo_023ff89410ef_Cfunc_test_structs, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._cgo_023ff89410ef_Cfunc_test_structs", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) - %3 = getelementptr inbounds %main._Ctype_struct___3, ptr %2, i32 0, i32 0 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___3", ptr %0, i32 0, i32 0 + store i32 1, ptr %1, align 4 + %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___4", ptr %2, i32 0, i32 0 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___4", ptr %2, i32 0, i32 1 store i32 1, ptr %3, align 4 - %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %5 = getelementptr inbounds %main._Ctype_struct___4, ptr %4, i32 0, i32 0 - %6 = getelementptr inbounds %main._Ctype_struct___4, ptr %4, i32 0, i32 1 - store i32 1, ptr %5, align 4 - store i32 2, ptr %6, align 4 - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 12) - %8 = getelementptr inbounds %main._Ctype_struct___0, ptr %7, i32 0, i32 0 - %9 = getelementptr inbounds %main._Ctype_struct___0, ptr %7, i32 0, i32 1 - %10 = getelementptr inbounds %main._Ctype_struct___0, ptr %7, i32 0, i32 2 - store i32 1, ptr %8, align 4 - store i32 2, ptr %9, align 4 - store i32 3, ptr %10, align 4 - %11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %12 = getelementptr inbounds %main._Ctype_struct___1, ptr %11, i32 0, i32 0 - %13 = getelementptr inbounds %main._Ctype_struct___1, ptr %11, i32 0, i32 1 - %14 = getelementptr inbounds %main._Ctype_struct___1, ptr %11, i32 0, i32 2 - %15 = getelementptr inbounds %main._Ctype_struct___1, ptr %11, i32 0, i32 3 - store i32 1, ptr %12, align 4 - store i32 2, ptr %13, align 4 - store i32 3, ptr %14, align 4 - store i32 4, ptr %15, align 4 - %16 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 20) - %17 = getelementptr inbounds %main._Ctype_struct___2, ptr %16, i32 0, i32 0 - %18 = getelementptr inbounds %main._Ctype_struct___2, ptr %16, i32 0, i32 1 - %19 = getelementptr inbounds %main._Ctype_struct___2, ptr %16, i32 0, i32 2 - %20 = getelementptr inbounds %main._Ctype_struct___2, ptr %16, i32 0, i32 3 - %21 = getelementptr inbounds %main._Ctype_struct___2, ptr %16, i32 0, i32 4 - store i32 1, ptr %17, align 4 - store i32 2, ptr %18, align 4 - store i32 3, ptr %19, align 4 - store i32 4, ptr %20, align 4 - store i32 5, ptr %21, align 4 - %22 = call i32 @main._Cfunc_test_structs(ptr %2, ptr %4, ptr %7, ptr %11, ptr %16) - %23 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %24 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %23, i64 0 - %25 = load ptr, ptr @_llgo_main._Ctype_int, align 8 - %26 = sext i32 %22 to i64 - %27 = inttoptr i64 %26 to ptr - %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %25, 0 - %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %28, ptr %27, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %29, ptr %24, align 8 - %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %23, 0 - %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30, i64 1, 1 - %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31, i64 1, 2 - %33 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Println(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %32) - %34 = icmp ne i32 %22, 35 - br i1 %34, label %_llgo_1, label %_llgo_2 + store i32 2, ptr %4, align 4 + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 12) + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___0", ptr %5, i32 0, i32 0 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___0", ptr %5, i32 0, i32 1 + %8 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___0", ptr %5, i32 0, i32 2 + store i32 1, ptr %6, align 4 + store i32 2, ptr %7, align 4 + store i32 3, ptr %8, align 4 + %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___1", ptr %9, i32 0, i32 0 + %11 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___1", ptr %9, i32 0, i32 1 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___1", ptr %9, i32 0, i32 2 + %13 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___1", ptr %9, i32 0, i32 3 + store i32 1, ptr %10, align 4 + store i32 2, ptr %11, align 4 + store i32 3, ptr %12, align 4 + store i32 4, ptr %13, align 4 + %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 20) + %15 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___2", ptr %14, i32 0, i32 0 + %16 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___2", ptr %14, i32 0, i32 1 + %17 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___2", ptr %14, i32 0, i32 2 + %18 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___2", ptr %14, i32 0, i32 3 + %19 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_struct___2", ptr %14, i32 0, i32 4 + store i32 1, ptr %15, align 4 + store i32 2, ptr %16, align 4 + store i32 3, ptr %17, align 4 + store i32 4, ptr %18, align 4 + store i32 5, ptr %19, align 4 + %20 = call i32 @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Cfunc_test_structs"(ptr %0, ptr %2, ptr %5, ptr %9, ptr %14) + %21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + %22 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %21, i64 0 + %23 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_int", align 8 + %24 = sext i32 %20 to i64 + %25 = inttoptr i64 %24 to ptr + %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %23, 0 + %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %26, ptr %25, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %27, ptr %22, align 8 + %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %21, 0 + %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28, i64 1, 1 + %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29, i64 1, 2 + %31 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @fmt.Println(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30) + %32 = icmp ne i32 %20, 35 + br i1 %32, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %35 = load ptr, ptr @_llgo_string, align 8 - %36 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 19 }, ptr %36, align 8 - %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %35, 0 - %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %37, ptr %36, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %38) + %33 = load ptr, ptr @_llgo_string, align 8 + %34 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 19 }, ptr %34, align 8 + %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %33, 0 + %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %35, ptr %34, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %36) unreachable _llgo_2: ; preds = %_llgo_0 - ret i32 0 + ret void } declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) @@ -135,12 +129,10 @@ declare void @syscall.init() declare void @fmt.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 10 }, i64 5, i64 4, i64 0, i64 0) - store ptr %0, ptr @_llgo_main._Ctype_int, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 10 }, i64 5, i64 4, i64 0, i64 0) + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/cgocfiles._Ctype_int", align 8 %1 = load ptr, ptr @_llgo_int32, align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 diff --git a/compiler/cl/_testgo/closure/out.ll b/compiler/cl/_testgo/closure/out.ll index 6a2a0391..9969376d 100644 --- a/compiler/cl/_testgo/closure/out.ll +++ b/compiler/cl/_testgo/closure/out.ll @@ -1,52 +1,46 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/closure' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/closure" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.T = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testgo/closure.T" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/closure.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [3 x i8] c"env", align 1 @1 = private unnamed_addr constant [4 x i8] c"func", align 1 @2 = private unnamed_addr constant [7 x i8] c"closure", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/closure.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/closure.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/closure.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/closure.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }, ptr %2, align 8 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %4 = getelementptr inbounds { ptr }, ptr %3, i32 0, i32 0 - store ptr %2, ptr %4, align 8 - %5 = insertvalue { ptr, ptr } { ptr @"main.main$2", ptr undef }, ptr %3, 1 - %6 = alloca %main.T, align 8 - store { ptr, ptr } %5, ptr %6, align 8 - %7 = load %main.T, ptr %6, align 8 - call void @"__llgo_stub.main.main$1"(ptr null, i64 100) - %8 = extractvalue %main.T %7, 1 - %9 = extractvalue %main.T %7, 0 - call void %9(ptr %8, i64 200) - ret i32 0 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }, ptr %0, align 8 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %2 = getelementptr inbounds { ptr }, ptr %1, i32 0, i32 0 + store ptr %0, ptr %2, align 8 + %3 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/closure.main$2", ptr undef }, ptr %1, 1 + %4 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/closure.T", align 8 + store { ptr, ptr } %3, ptr %4, align 8 + %5 = load %"github.com/goplus/llgo/compiler/cl/_testgo/closure.T", ptr %4, align 8 + call void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/closure.main$1"(ptr null, i64 100) + %6 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/closure.T" %5, 1 + %7 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/closure.T" %5, 0 + call void %7(ptr %6, i64 200) + ret void } -define void @"main.main$1"(i64 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/closure.main$1"(i64 %0) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -55,7 +49,7 @@ _llgo_0: ret void } -define void @"main.main$2"(ptr %0, i64 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/closure.main$2"(ptr %0, i64 %1) { _llgo_0: %2 = load { ptr }, ptr %0, align 8 %3 = extractvalue { ptr } %2, 0 @@ -69,13 +63,11 @@ _llgo_0: ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define linkonce void @"__llgo_stub.main.main$1"(ptr %0, i64 %1) { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/closure.main$1"(ptr %0, i64 %1) { _llgo_0: - tail call void @"main.main$1"(i64 %1) + tail call void @"github.com/goplus/llgo/compiler/cl/_testgo/closure.main$1"(i64 %1) ret void } diff --git a/compiler/cl/_testgo/closure2/out.ll b/compiler/cl/_testgo/closure2/out.ll index 230ef158..d99956d5 100644 --- a/compiler/cl/_testgo/closure2/out.ll +++ b/compiler/cl/_testgo/closure2/out.ll @@ -1,59 +1,53 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/closure2' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/closure2" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/closure2.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [7 x i8] c"closure", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/closure2.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/closure2.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/closure2.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/closure2.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - store i64 1, ptr %2, align 4 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %4 = getelementptr inbounds { ptr }, ptr %3, i32 0, i32 0 - store ptr %2, ptr %4, align 8 - %5 = insertvalue { ptr, ptr } { ptr @"main.main$1", ptr undef }, ptr %3, 1 - %6 = extractvalue { ptr, ptr } %5, 1 - %7 = extractvalue { ptr, ptr } %5, 0 - %8 = call { ptr, ptr } %7(ptr %6, i64 1) - %9 = extractvalue { ptr, ptr } %8, 1 - %10 = extractvalue { ptr, ptr } %8, 0 - call void %10(ptr %9, i64 2) - ret i32 0 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + store i64 1, ptr %0, align 4 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %2 = getelementptr inbounds { ptr }, ptr %1, i32 0, i32 0 + store ptr %0, ptr %2, align 8 + %3 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/closure2.main$1", ptr undef }, ptr %1, 1 + %4 = extractvalue { ptr, ptr } %3, 1 + %5 = extractvalue { ptr, ptr } %3, 0 + %6 = call { ptr, ptr } %5(ptr %4, i64 1) + %7 = extractvalue { ptr, ptr } %6, 1 + %8 = extractvalue { ptr, ptr } %6, 0 + call void %8(ptr %7, i64 2) + ret void } -define { ptr, ptr } @"main.main$1"(ptr %0, i64 %1) { +define { ptr, ptr } @"github.com/goplus/llgo/compiler/cl/_testgo/closure2.main$1"(ptr %0, i64 %1) { _llgo_0: %2 = load { ptr }, ptr %0, align 8 %3 = extractvalue { ptr } %2, 0 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %5 = getelementptr inbounds { ptr }, ptr %4, i32 0, i32 0 store ptr %3, ptr %5, align 8 - %6 = insertvalue { ptr, ptr } { ptr @"main.main$1$1", ptr undef }, ptr %4, 1 + %6 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/closure2.main$1$1", ptr undef }, ptr %4, 1 ret { ptr, ptr } %6 } -define void @"main.main$1$1"(ptr %0, i64 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/closure2.main$1$1"(ptr %0, i64 %1) { _llgo_0: %2 = load { ptr }, ptr %0, align 8 %3 = extractvalue { ptr } %2, 0 @@ -67,8 +61,6 @@ _llgo_0: ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) diff --git a/compiler/cl/_testgo/constconv/out.ll b/compiler/cl/_testgo/constconv/out.ll index 97380d4c..d2e9cea8 100644 --- a/compiler/cl/_testgo/constconv/out.ll +++ b/compiler/cl/_testgo/constconv/out.ll @@ -1,29 +1,23 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/constconv' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/constconv" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/constconv.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/constconv.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/constconv.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/constconv.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/constconv.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 1) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 1) @@ -32,11 +26,9 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 11) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testgo/equal/out.ll b/compiler/cl/_testgo/equal/out.ll index 5e03304f..e4da061a 100644 --- a/compiler/cl/_testgo/equal/out.ll +++ b/compiler/cl/_testgo/equal/out.ll @@ -1,22 +1,22 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/equal' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/equal" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -%main.T = type { i64, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.eface" } +%"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" = type { i64, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.eface" } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -%main.N = type {} +%"github.com/goplus/llgo/compiler/cl/_testgo/equal.N" = type {} %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/equal.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [6 x i8] c"failed", align 1 @_llgo_string = linkonce global ptr null, align 8 @1 = private unnamed_addr constant [5 x i8] c"hello", align 1 @_llgo_int = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [2 x i8] c"ok", align 1 @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw" = linkonce global ptr null, align 8 -@3 = private unnamed_addr constant [4 x i8] c"main", align 1 -@_llgo_main.T = linkonce global ptr null, align 8 +@3 = private unnamed_addr constant [48 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/equal", align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.T" = linkonce global ptr null, align 8 @4 = private unnamed_addr constant [1 x i8] c"T", align 1 @_llgo_any = linkonce global ptr null, align 8 @"_llgo_struct$5D_KhR3tDEp-wpx9caTiVZca43wS-XW6slE9Bsr8rsk" = linkonce global ptr null, align 8 @@ -24,17 +24,15 @@ source_filename = "main" @6 = private unnamed_addr constant [1 x i8] c"Y", align 1 @7 = private unnamed_addr constant [1 x i8] c"Z", align 1 @8 = private unnamed_addr constant [1 x i8] c"V", align 1 -@_llgo_main.N = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.N" = linkonce global ptr null, align 8 @9 = private unnamed_addr constant [1 x i8] c"N", align 1 @"map[_llgo_int]_llgo_string" = linkonce global ptr null, align 8 @10 = private unnamed_addr constant [7 x i8] c"topbits", align 1 @11 = private unnamed_addr constant [4 x i8] c"keys", align 1 @12 = private unnamed_addr constant [5 x i8] c"elems", align 1 @13 = private unnamed_addr constant [8 x i8] c"overflow", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -define void @main.assert(i1 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %0) { _llgo_0: br i1 %0, label %_llgo_2, label %_llgo_1 @@ -51,58 +49,58 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/equal.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 - call void @"main.init$after"() - call void @"main.init#1"() - call void @"main.init#2"() - call void @"main.init#3"() - call void @"main.init#4"() - call void @"main.init#5"() - call void @"main.init#6"() - call void @"main.init#7"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init$after"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#1"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#2"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#3"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#4"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#5"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#6"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#7"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define void @"main.init#1"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#1"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %2 = getelementptr inbounds { ptr }, ptr %1, i32 0, i32 0 store ptr %0, ptr %2, align 8 - %3 = insertvalue { ptr, ptr } { ptr @"main.init#1$2", ptr undef }, ptr %1, 1 - call void @main.assert(i1 true) - call void @main.assert(i1 true) - call void @main.assert(i1 true) - call void @main.assert(i1 true) - call void @main.assert(i1 true) - call void @main.assert(i1 true) + %3 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#1$2", ptr undef }, ptr %1, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) %4 = extractvalue { ptr, ptr } %3, 0 %5 = icmp ne ptr %4, null - call void @main.assert(i1 %5) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %5) %6 = extractvalue { ptr, ptr } %3, 0 %7 = icmp ne ptr null, %6 - call void @main.assert(i1 %7) - call void @main.assert(i1 true) - call void @main.assert(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %7) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) ret void } -define i64 @"main.init#1$1"(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#1$1"(i64 %0, i64 %1) { _llgo_0: %2 = add i64 %0, %1 ret i64 %2 } -define void @"main.init#1$2"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#1$2"(ptr %0) { _llgo_0: %1 = load { ptr }, ptr %0, align 8 %2 = extractvalue { ptr } %1, 0 @@ -112,9 +110,9 @@ _llgo_0: ret void } -define void @"main.init#2"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#2"() { _llgo_0: - call void @main.assert(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) %0 = alloca [3 x i64], align 8 call void @llvm.memset(ptr %0, i8 0, i64 24, i1 false) %1 = getelementptr inbounds i64, ptr %0, i64 0 @@ -145,7 +143,7 @@ _llgo_0: %19 = extractvalue [3 x i64] %9, 2 %20 = icmp eq i64 %18, %19 %21 = and i1 %17, %20 - call void @main.assert(i1 %21) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %21) %22 = getelementptr inbounds i64, ptr %4, i64 1 store i64 1, ptr %22, align 4 %23 = load [3 x i64], ptr %0, align 4 @@ -163,18 +161,18 @@ _llgo_0: %35 = icmp eq i64 %33, %34 %36 = and i1 %32, %35 %37 = xor i1 %36, true - call void @main.assert(i1 %37) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %37) ret void } -define void @"main.init#3"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#3"() { _llgo_0: - %0 = alloca %main.T, align 8 + %0 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 call void @llvm.memset(ptr %0, i8 0, i64 48, i1 false) - %1 = getelementptr inbounds %main.T, ptr %0, i32 0, i32 0 - %2 = getelementptr inbounds %main.T, ptr %0, i32 0, i32 1 - %3 = getelementptr inbounds %main.T, ptr %0, i32 0, i32 2 - %4 = getelementptr inbounds %main.T, ptr %0, i32 0, i32 3 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %0, i32 0, i32 1 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %0, i32 0, i32 2 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %0, i32 0, i32 3 store i64 10, ptr %1, align 4 store i64 20, ptr %2, align 4 store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, ptr %3, align 8 @@ -182,12 +180,12 @@ _llgo_0: %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %5, 0 %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr inttoptr (i64 1 to ptr), 1 store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr %4, align 8 - %8 = alloca %main.T, align 8 + %8 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 call void @llvm.memset(ptr %8, i8 0, i64 48, i1 false) - %9 = getelementptr inbounds %main.T, ptr %8, i32 0, i32 0 - %10 = getelementptr inbounds %main.T, ptr %8, i32 0, i32 1 - %11 = getelementptr inbounds %main.T, ptr %8, i32 0, i32 2 - %12 = getelementptr inbounds %main.T, ptr %8, i32 0, i32 3 + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %8, i32 0, i32 0 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %8, i32 0, i32 1 + %11 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %8, i32 0, i32 2 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %8, i32 0, i32 3 store i64 10, ptr %9, align 4 store i64 20, ptr %10, align 4 store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, ptr %11, align 8 @@ -195,12 +193,12 @@ _llgo_0: %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %13, 0 %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %14, ptr inttoptr (i64 1 to ptr), 1 store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %15, ptr %12, align 8 - %16 = alloca %main.T, align 8 + %16 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 call void @llvm.memset(ptr %16, i8 0, i64 48, i1 false) - %17 = getelementptr inbounds %main.T, ptr %16, i32 0, i32 0 - %18 = getelementptr inbounds %main.T, ptr %16, i32 0, i32 1 - %19 = getelementptr inbounds %main.T, ptr %16, i32 0, i32 2 - %20 = getelementptr inbounds %main.T, ptr %16, i32 0, i32 3 + %17 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %16, i32 0, i32 0 + %18 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %16, i32 0, i32 1 + %19 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %16, i32 0, i32 2 + %20 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %16, i32 0, i32 3 store i64 10, ptr %17, align 4 store i64 20, ptr %18, align 4 store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, ptr %19, align 8 @@ -210,75 +208,75 @@ _llgo_0: %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %21, 0 %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %23, ptr %22, 1 store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %24, ptr %20, align 8 - call void @main.assert(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) %25 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer) %26 = and i1 true, %25 %27 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.eface" zeroinitializer) %28 = and i1 %26, %27 - call void @main.assert(i1 %28) - %29 = load %main.T, ptr %0, align 8 - %30 = load %main.T, ptr %8, align 8 - %31 = extractvalue %main.T %29, 0 - %32 = extractvalue %main.T %30, 0 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %28) + %29 = load %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %0, align 8 + %30 = load %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %8, align 8 + %31 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %29, 0 + %32 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %30, 0 %33 = icmp eq i64 %31, %32 %34 = and i1 true, %33 - %35 = extractvalue %main.T %29, 1 - %36 = extractvalue %main.T %30, 1 + %35 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %29, 1 + %36 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %30, 1 %37 = icmp eq i64 %35, %36 %38 = and i1 %34, %37 - %39 = extractvalue %main.T %29, 2 - %40 = extractvalue %main.T %30, 2 + %39 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %29, 2 + %40 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %30, 2 %41 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %39, %"github.com/goplus/llgo/runtime/internal/runtime.String" %40) %42 = and i1 %38, %41 - %43 = extractvalue %main.T %29, 3 - %44 = extractvalue %main.T %30, 3 + %43 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %29, 3 + %44 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %30, 3 %45 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %43, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %44) %46 = and i1 %42, %45 - call void @main.assert(i1 %46) - %47 = load %main.T, ptr %0, align 8 - %48 = load %main.T, ptr %16, align 8 - %49 = extractvalue %main.T %47, 0 - %50 = extractvalue %main.T %48, 0 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %46) + %47 = load %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %0, align 8 + %48 = load %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %16, align 8 + %49 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %47, 0 + %50 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %48, 0 %51 = icmp eq i64 %49, %50 %52 = and i1 true, %51 - %53 = extractvalue %main.T %47, 1 - %54 = extractvalue %main.T %48, 1 + %53 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %47, 1 + %54 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %48, 1 %55 = icmp eq i64 %53, %54 %56 = and i1 %52, %55 - %57 = extractvalue %main.T %47, 2 - %58 = extractvalue %main.T %48, 2 + %57 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %47, 2 + %58 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %48, 2 %59 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %57, %"github.com/goplus/llgo/runtime/internal/runtime.String" %58) %60 = and i1 %56, %59 - %61 = extractvalue %main.T %47, 3 - %62 = extractvalue %main.T %48, 3 + %61 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %47, 3 + %62 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %48, 3 %63 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %61, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %62) %64 = and i1 %60, %63 %65 = xor i1 %64, true - call void @main.assert(i1 %65) - %66 = load %main.T, ptr %8, align 8 - %67 = load %main.T, ptr %16, align 8 - %68 = extractvalue %main.T %66, 0 - %69 = extractvalue %main.T %67, 0 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %65) + %66 = load %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %8, align 8 + %67 = load %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %16, align 8 + %68 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %66, 0 + %69 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %67, 0 %70 = icmp eq i64 %68, %69 %71 = and i1 true, %70 - %72 = extractvalue %main.T %66, 1 - %73 = extractvalue %main.T %67, 1 + %72 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %66, 1 + %73 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %67, 1 %74 = icmp eq i64 %72, %73 %75 = and i1 %71, %74 - %76 = extractvalue %main.T %66, 2 - %77 = extractvalue %main.T %67, 2 + %76 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %66, 2 + %77 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %67, 2 %78 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %76, %"github.com/goplus/llgo/runtime/internal/runtime.String" %77) %79 = and i1 %75, %78 - %80 = extractvalue %main.T %66, 3 - %81 = extractvalue %main.T %67, 3 + %80 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %66, 3 + %81 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %67, 3 %82 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %80, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %81) %83 = and i1 %79, %82 %84 = xor i1 %83, true - call void @main.assert(i1 %84) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %84) ret void } -define void @"main.init#4"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#4"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) %1 = getelementptr inbounds i64, ptr %0, i64 0 @@ -294,21 +292,21 @@ _llgo_0: %8 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %7, i64 8, i64 2, i64 0, i64 2, i64 2) %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) %10 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %9, i64 8, i64 2, i64 0, i64 0, i64 2) - call void @main.assert(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) %11 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, 0 %12 = icmp ne ptr %11, null - call void @main.assert(i1 %12) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %12) %13 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, 0 %14 = icmp ne ptr %13, null - call void @main.assert(i1 %14) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %14) %15 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10, 0 %16 = icmp ne ptr %15, null - call void @main.assert(i1 %16) - call void @main.assert(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %16) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) ret void } -define void @"main.init#5"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#5"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 @@ -318,12 +316,12 @@ _llgo_0: store {} zeroinitializer, ptr %4, align 1 %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0 %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr %4, 1 - %7 = alloca %main.T, align 8 + %7 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 call void @llvm.memset(ptr %7, i8 0, i64 48, i1 false) - %8 = getelementptr inbounds %main.T, ptr %7, i32 0, i32 0 - %9 = getelementptr inbounds %main.T, ptr %7, i32 0, i32 1 - %10 = getelementptr inbounds %main.T, ptr %7, i32 0, i32 2 - %11 = getelementptr inbounds %main.T, ptr %7, i32 0, i32 3 + %8 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %7, i32 0, i32 0 + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %7, i32 0, i32 1 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %7, i32 0, i32 2 + %11 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %7, i32 0, i32 3 store i64 10, ptr %8, align 4 store i64 20, ptr %9, align 4 store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, ptr %10, align 8 @@ -331,18 +329,18 @@ _llgo_0: %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %12, 0 %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, ptr inttoptr (i64 1 to ptr), 1 store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %14, ptr %11, align 8 - %15 = load %main.T, ptr %7, align 8 - %16 = load ptr, ptr @_llgo_main.T, align 8 + %15 = load %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %7, align 8 + %16 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) - store %main.T %15, ptr %17, align 8 + store %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %15, ptr %17, align 8 %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %16, 0 %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %18, ptr %17, 1 - %20 = alloca %main.T, align 8 + %20 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 call void @llvm.memset(ptr %20, i8 0, i64 48, i1 false) - %21 = getelementptr inbounds %main.T, ptr %20, i32 0, i32 0 - %22 = getelementptr inbounds %main.T, ptr %20, i32 0, i32 1 - %23 = getelementptr inbounds %main.T, ptr %20, i32 0, i32 2 - %24 = getelementptr inbounds %main.T, ptr %20, i32 0, i32 3 + %21 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %20, i32 0, i32 0 + %22 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %20, i32 0, i32 1 + %23 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %20, i32 0, i32 2 + %24 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %20, i32 0, i32 3 store i64 10, ptr %21, align 4 store i64 20, ptr %22, align 4 store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, ptr %23, align 8 @@ -350,12 +348,12 @@ _llgo_0: %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %25, 0 %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %26, ptr inttoptr (i64 1 to ptr), 1 store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %27, ptr %24, align 8 - %28 = alloca %main.T, align 8 + %28 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 call void @llvm.memset(ptr %28, i8 0, i64 48, i1 false) - %29 = getelementptr inbounds %main.T, ptr %28, i32 0, i32 0 - %30 = getelementptr inbounds %main.T, ptr %28, i32 0, i32 1 - %31 = getelementptr inbounds %main.T, ptr %28, i32 0, i32 2 - %32 = getelementptr inbounds %main.T, ptr %28, i32 0, i32 3 + %29 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %28, i32 0, i32 0 + %30 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %28, i32 0, i32 1 + %31 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %28, i32 0, i32 2 + %32 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %28, i32 0, i32 3 store i64 10, ptr %29, align 4 store i64 20, ptr %30, align 4 store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, ptr %31, align 8 @@ -369,80 +367,76 @@ _llgo_0: %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %37, 0 %39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %38, ptr inttoptr (i64 100 to ptr), 1 %40 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %39) - call void @main.assert(i1 %40) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %40) %41 = load ptr, ptr @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw", align 8 %42 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) store {} zeroinitializer, ptr %42, align 1 %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %41, 0 %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %43, ptr %42, 1 %45 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %44) - call void @main.assert(i1 %45) - %46 = load ptr, ptr @_llgo_main.N, align 8 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %45) + %46 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.N", align 8 %47 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) - store %main.N zeroinitializer, ptr %47, align 1 + store %"github.com/goplus/llgo/compiler/cl/_testgo/equal.N" zeroinitializer, ptr %47, align 1 %48 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %46, 0 %49 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %48, ptr %47, 1 %50 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %49) %51 = xor i1 %50, true - call void @main.assert(i1 %51) - %52 = load %main.T, ptr %20, align 8 - %53 = load ptr, ptr @_llgo_main.T, align 8 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %51) + %52 = load %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %20, align 8 + %53 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 %54 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) - store %main.T %52, ptr %54, align 8 + store %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %52, ptr %54, align 8 %55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %53, 0 %56 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %55, ptr %54, 1 %57 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %19, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %56) - call void @main.assert(i1 %57) - %58 = load %main.T, ptr %28, align 8 - %59 = load ptr, ptr @_llgo_main.T, align 8 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %57) + %58 = load %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T", ptr %28, align 8 + %59 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 %60 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) - store %main.T %58, ptr %60, align 8 + store %"github.com/goplus/llgo/compiler/cl/_testgo/equal.T" %58, ptr %60, align 8 %61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %59, 0 %62 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %61, ptr %60, 1 %63 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %19, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %62) %64 = xor i1 %63, true - call void @main.assert(i1 %64) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %64) ret void } -define void @"main.init#6"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#6"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 8, i64 0) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 8, i64 0) %2 = icmp eq ptr %0, %0 - call void @main.assert(i1 %2) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %2) %3 = icmp ne ptr %0, %1 - call void @main.assert(i1 %3) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %3) %4 = icmp ne ptr %0, null - call void @main.assert(i1 %4) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %4) ret void } -define void @"main.init#7"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init#7"() { _llgo_0: %0 = load ptr, ptr @"map[_llgo_int]_llgo_string", align 8 %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %0, i64 0) %2 = icmp ne ptr %1, null - call void @main.assert(i1 %2) - call void @main.assert(i1 true) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 %2) + call void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.assert"(i1 true) ret void } -define i32 @main(i32 %0, ptr %1) { -_llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - ret i32 0 -} - -define void @main.test() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.main"() { _llgo_0: ret void } -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.test"() { +_llgo_0: + ret void +} + +define void @"github.com/goplus/llgo/compiler/cl/_testgo/equal.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_string, align 8 %1 = icmp eq ptr %0, null @@ -468,15 +462,15 @@ _llgo_4: ; preds = %_llgo_3, %_llgo_2 %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %6, 0 %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 0, 1 %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 0, 2 - %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) + %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 48 }, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) store ptr %10, ptr @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw", align 8 - %11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }, i64 25, i64 48, i64 0, i64 0) - %12 = load ptr, ptr @_llgo_main.T, align 8 + %11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }, i64 25, i64 48, i64 0, i64 0) + %12 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 %13 = icmp eq ptr %12, null br i1 %13, label %_llgo_5, label %_llgo_6 _llgo_5: ; preds = %_llgo_4 - store ptr %11, ptr @_llgo_main.T, align 8 + store ptr %11, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.T", align 8 br label %_llgo_6 _llgo_6: ; preds = %_llgo_5, %_llgo_4 @@ -489,7 +483,7 @@ _llgo_7: ; preds = %_llgo_6 %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %16, 0 %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, i64 0, 1 %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18, i64 0, 2 - %20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19) + %20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19) store ptr %20, ptr @_llgo_any, align 8 br label %_llgo_8 @@ -505,7 +499,7 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_6 %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %28, 0 %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29, i64 0, 1 %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30, i64 0, 2 - %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31) + %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31) %33 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 1 }, ptr %32, i64 32, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %34 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 224) %35 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %34, i64 0 @@ -519,7 +513,7 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_6 %39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %34, 0 %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %39, i64 4, 1 %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40, i64 4, 2 - %42 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, i64 48, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %41) + %42 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 48 }, i64 48, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %41) store ptr %42, ptr @"_llgo_struct$5D_KhR3tDEp-wpx9caTiVZca43wS-XW6slE9Bsr8rsk", align 8 %43 = load ptr, ptr @"_llgo_struct$5D_KhR3tDEp-wpx9caTiVZca43wS-XW6slE9Bsr8rsk", align 8 br i1 %13, label %_llgo_9, label %_llgo_10 @@ -529,13 +523,13 @@ _llgo_9: ; preds = %_llgo_8 br label %_llgo_10 _llgo_10: ; preds = %_llgo_9, %_llgo_8 - %44 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 0, i64 0, i64 0) - %45 = load ptr, ptr @_llgo_main.N, align 8 + %44 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 0, i64 0, i64 0) + %45 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.N", align 8 %46 = icmp eq ptr %45, null br i1 %46, label %_llgo_11, label %_llgo_12 _llgo_11: ; preds = %_llgo_10 - store ptr %44, ptr @_llgo_main.N, align 8 + store ptr %44, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/equal.N", align 8 br label %_llgo_12 _llgo_12: ; preds = %_llgo_11, %_llgo_10 @@ -577,7 +571,7 @@ _llgo_15: ; preds = %_llgo_14 %68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %63, 0 %69 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68, i64 4, 1 %70 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %69, i64 4, 2 - %71 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %70) + %71 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 48 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %70) %72 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %50, ptr %51, ptr %71, i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %72) store ptr %72, ptr @"map[_llgo_int]_llgo_string", align 8 @@ -628,6 +622,4 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(p declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr, i64) -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/compiler/cl/_testgo/errors/out.ll b/compiler/cl/_testgo/errors/out.ll index 625319c3..d3f7d604 100644 --- a/compiler/cl/_testgo/errors/out.ll +++ b/compiler/cl/_testgo/errors/out.ll @@ -1,36 +1,34 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/errors' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/errors" %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.errorString = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } +%"github.com/goplus/llgo/compiler/cl/_testgo/errors.errorString" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } %"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } -@"main.init$guard" = global i1 false, align 1 -@_llgo_main.errorString = linkonce global ptr null, align 8 -@0 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/errors.init$guard" = global i1 false, align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/errors.errorString" = linkonce global ptr null, align 8 +@0 = private unnamed_addr constant [49 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/errors", align 1 @1 = private unnamed_addr constant [11 x i8] c"errorString", align 1 @_llgo_string = linkonce global ptr null, align 8 -@"main.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/errors.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ" = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [1 x i8] c"s", align 1 @3 = private unnamed_addr constant [5 x i8] c"Error", align 1 @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to" = linkonce global ptr null, align 8 -@"*_llgo_main.errorString" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/errors.errorString" = linkonce global ptr null, align 8 @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU" = linkonce global ptr null, align 8 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @4 = private unnamed_addr constant [8 x i8] c"an error", align 1 -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.New(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/errors.New"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %2 = getelementptr inbounds %main.errorString, ptr %1, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/errors.errorString", ptr %1, i32 0, i32 0 store %"github.com/goplus/llgo/runtime/internal/runtime.String" %0, ptr %2, align 8 - %3 = load ptr, ptr @_llgo_main.errorString, align 8 - %4 = load ptr, ptr @"*_llgo_main.errorString", align 8 + %3 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/errors.errorString", align 8 + %4 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/errors.errorString", align 8 %5 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 %6 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8 %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %6, ptr %4) @@ -39,56 +37,52 @@ _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %9 } -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"main.(*errorString).Error"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testgo/errors.(*errorString).Error"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.errorString, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/errors.errorString", ptr %0, i32 0, i32 0 %2 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %1, align 8 ret %"github.com/goplus/llgo/runtime/internal/runtime.String" %2 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/errors.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/errors.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/errors.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/errors.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/errors.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.New(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 8 }) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %2) + %0 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/errors.New"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 8 }) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %2) - %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2, 0 - %5 = getelementptr ptr, ptr %4, i64 3 - %6 = load ptr, ptr %5, align 8 - %7 = insertvalue { ptr, ptr } undef, ptr %6, 0 - %8 = insertvalue { ptr, ptr } %7, ptr %3, 1 - %9 = extractvalue { ptr, ptr } %8, 1 - %10 = extractvalue { ptr, ptr } %8, 0 - %11 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %10(ptr %9) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %11) + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) + %2 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, 0 + %3 = getelementptr ptr, ptr %2, i64 3 + %4 = load ptr, ptr %3, align 8 + %5 = insertvalue { ptr, ptr } undef, ptr %4, 0 + %6 = insertvalue { ptr, ptr } %5, ptr %1, 1 + %7 = extractvalue { ptr, ptr } %6, 1 + %8 = extractvalue { ptr, ptr } %6, 0 + %9 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %8(ptr %7) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %9) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/errors.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 11 }, i64 25, i64 16, i64 0, i64 1) - store ptr %0, ptr @_llgo_main.errorString, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 11 }, i64 25, i64 16, i64 0, i64 1) + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/errors.errorString", align 8 %1 = load ptr, ptr @_llgo_string, align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 @@ -108,9 +102,9 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %7, 0 %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, i64 1, 1 %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10, i64 1, 2 - %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %11) - store ptr %12, ptr @"main.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 - %13 = load ptr, ptr @"main.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 + %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %11) + store ptr %12, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/errors.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 + %13 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/errors.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 %14 = load ptr, ptr @_llgo_string, align 8 %15 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 %16 = icmp eq ptr %15, null @@ -135,8 +129,8 @@ _llgo_3: ; preds = %_llgo_2 _llgo_4: ; preds = %_llgo_3, %_llgo_2 %27 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 %28 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 5 }, ptr undef, ptr undef, ptr undef }, ptr %27, 1 - %29 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %28, ptr @"main.(*errorString).Error", 2 - %30 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %29, ptr @"main.(*errorString).Error", 3 + %29 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %28, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/errors.(*errorString).Error", 2 + %30 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %29, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/errors.(*errorString).Error", 3 %31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %32 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %31, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %30, ptr %32, align 8 @@ -144,10 +138,10 @@ _llgo_4: ; preds = %_llgo_3, %_llgo_2 %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %33, i64 1, 1 %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %34, i64 1, 2 call void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr %0, ptr %13, { ptr, i64, i64 } zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35) - %36 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 11 }, i64 25, i64 16, i64 0, i64 1) + %36 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 11 }, i64 25, i64 16, i64 0, i64 1) %37 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %36) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %37) - store ptr %37, ptr @"*_llgo_main.errorString", align 8 + store ptr %37, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/errors.errorString", align 8 %38 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 %39 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8 %40 = icmp eq ptr %39, null @@ -161,7 +155,7 @@ _llgo_5: ; preds = %_llgo_4 %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %42, 0 %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %44, i64 1, 1 %46 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %45, i64 1, 2 - %47 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %46) + %47 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %46) store ptr %47, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8 br label %_llgo_6 @@ -191,8 +185,6 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"githu declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr, ptr) -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface") declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testgo/goroutine/out.ll b/compiler/cl/_testgo/goroutine/out.ll index 035c3597..5a9dcc1a 100644 --- a/compiler/cl/_testgo/goroutine/out.ll +++ b/compiler/cl/_testgo/goroutine/out.ll @@ -1,52 +1,46 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/goroutine' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/goroutine" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/goroutine.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [5 x i8] c"hello", align 1 @1 = private unnamed_addr constant [16 x i8] c"Hello, goroutine", align 1 @2 = private unnamed_addr constant [1 x i8] c".", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 1) - store i1 false, ptr %2, align 1 - %3 = call ptr @malloc(i64 16) - %4 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.String" }, ptr %3, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %4, align 8 - %5 = alloca i8, i64 8, align 1 - %6 = call i32 @"github.com/goplus/llgo/runtime/internal/runtime.CreateThread"(ptr %5, ptr null, ptr @"main._llgo_routine$1", ptr %3) - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %8 = getelementptr inbounds { ptr }, ptr %7, i32 0, i32 0 - store ptr %2, ptr %8, align 8 - %9 = insertvalue { ptr, ptr } { ptr @"main.main$1", ptr undef }, ptr %7, 1 - %10 = call ptr @malloc(i64 32) - %11 = getelementptr inbounds { { ptr, ptr }, %"github.com/goplus/llgo/runtime/internal/runtime.String" }, ptr %10, i32 0, i32 0 - store { ptr, ptr } %9, ptr %11, align 8 - %12 = getelementptr inbounds { { ptr, ptr }, %"github.com/goplus/llgo/runtime/internal/runtime.String" }, ptr %10, i32 0, i32 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 16 }, ptr %12, align 8 - %13 = alloca i8, i64 8, align 1 - %14 = call i32 @"github.com/goplus/llgo/runtime/internal/runtime.CreateThread"(ptr %13, ptr null, ptr @"main._llgo_routine$2", ptr %10) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 1) + store i1 false, ptr %0, align 1 + %1 = call ptr @malloc(i64 16) + %2 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.String" }, ptr %1, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %2, align 8 + %3 = alloca i8, i64 8, align 1 + %4 = call i32 @"github.com/goplus/llgo/runtime/internal/runtime.CreateThread"(ptr %3, ptr null, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine._llgo_routine$1", ptr %1) + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %6 = getelementptr inbounds { ptr }, ptr %5, i32 0, i32 0 + store ptr %0, ptr %6, align 8 + %7 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine.main$1", ptr undef }, ptr %5, 1 + %8 = call ptr @malloc(i64 32) + %9 = getelementptr inbounds { { ptr, ptr }, %"github.com/goplus/llgo/runtime/internal/runtime.String" }, ptr %8, i32 0, i32 0 + store { ptr, ptr } %7, ptr %9, align 8 + %10 = getelementptr inbounds { { ptr, ptr }, %"github.com/goplus/llgo/runtime/internal/runtime.String" }, ptr %8, i32 0, i32 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 16 }, ptr %10, align 8 + %11 = alloca i8, i64 8, align 1 + %12 = call i32 @"github.com/goplus/llgo/runtime/internal/runtime.CreateThread"(ptr %11, ptr null, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine._llgo_routine$2", ptr %8) br label %_llgo_3 _llgo_1: ; preds = %_llgo_3 @@ -54,14 +48,14 @@ _llgo_1: ; preds = %_llgo_3 br label %_llgo_3 _llgo_2: ; preds = %_llgo_3 - ret i32 0 + ret void _llgo_3: ; preds = %_llgo_1, %_llgo_0 - %15 = load i1, ptr %2, align 1 - br i1 %15, label %_llgo_2, label %_llgo_1 + %13 = load i1, ptr %0, align 1 + br i1 %13, label %_llgo_2, label %_llgo_1 } -define void @"main.main$1"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine.main$1"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %1) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) @@ -71,13 +65,11 @@ _llgo_0: ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare ptr @malloc(i64) -define ptr @"main._llgo_routine$1"(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine._llgo_routine$1"(ptr %0) { _llgo_0: %1 = load { %"github.com/goplus/llgo/runtime/internal/runtime.String" }, ptr %0, align 8 %2 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String" } %1, 0 @@ -97,7 +89,7 @@ declare i32 @"github.com/goplus/llgo/runtime/internal/runtime.CreateThread"(ptr, declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) -define ptr @"main._llgo_routine$2"(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testgo/goroutine._llgo_routine$2"(ptr %0) { _llgo_0: %1 = load { { ptr, ptr }, %"github.com/goplus/llgo/runtime/internal/runtime.String" }, ptr %0, align 8 %2 = extractvalue { { ptr, ptr }, %"github.com/goplus/llgo/runtime/internal/runtime.String" } %1, 0 diff --git a/compiler/cl/_testgo/ifaceconv/out.ll b/compiler/cl/_testgo/ifaceconv/out.ll index d5903cff..c7808e26 100644 --- a/compiler/cl/_testgo/ifaceconv/out.ll +++ b/compiler/cl/_testgo/ifaceconv/out.ll @@ -1,8 +1,8 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv" -%main.C1 = type {} -%main.C2 = type {} +%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1" = type {} +%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2" = type {} %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } @@ -11,33 +11,31 @@ source_filename = "main" %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -@_llgo_main.I0 = linkonce global ptr null, align 8 -@0 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.init$guard" = global i1 false, align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I0" = linkonce global ptr null, align 8 +@0 = private unnamed_addr constant [52 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv", align 1 @1 = private unnamed_addr constant [2 x i8] c"I0", align 1 @2 = private unnamed_addr constant [21 x i8] c"nil i0.(I0) succeeded", align 1 @_llgo_string = linkonce global ptr null, align 8 -@_llgo_main.I1 = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I1" = linkonce global ptr null, align 8 @3 = private unnamed_addr constant [2 x i8] c"I1", align 1 @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac" = linkonce global ptr null, align 8 -@4 = private unnamed_addr constant [6 x i8] c"main.f", align 1 -@"main.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4" = linkonce global ptr null, align 8 +@4 = private unnamed_addr constant [54 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.f", align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4" = linkonce global ptr null, align 8 @5 = private unnamed_addr constant [21 x i8] c"nil i1.(I1) succeeded", align 1 -@_llgo_main.I2 = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I2" = linkonce global ptr null, align 8 @6 = private unnamed_addr constant [2 x i8] c"I2", align 1 -@7 = private unnamed_addr constant [6 x i8] c"main.g", align 1 -@"main.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw" = linkonce global ptr null, align 8 +@7 = private unnamed_addr constant [54 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.g", align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw" = linkonce global ptr null, align 8 @8 = private unnamed_addr constant [21 x i8] c"nil i2.(I2) succeeded", align 1 -@_llgo_main.C1 = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1" = linkonce global ptr null, align 8 @9 = private unnamed_addr constant [2 x i8] c"C1", align 1 @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw" = linkonce global ptr null, align 8 @10 = private unnamed_addr constant [1 x i8] c"f", align 1 @11 = private unnamed_addr constant [17 x i8] c"C1 i1.(I0) failed", align 1 @12 = private unnamed_addr constant [17 x i8] c"C1 i1.(I1) failed", align 1 @13 = private unnamed_addr constant [20 x i8] c"C1 i1.(I2) succeeded", align 1 -@_llgo_main.C2 = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2" = linkonce global ptr null, align 8 @14 = private unnamed_addr constant [2 x i8] c"C2", align 1 @15 = private unnamed_addr constant [1 x i8] c"g", align 1 @16 = private unnamed_addr constant [17 x i8] c"C2 i1.(I0) failed", align 1 @@ -47,268 +45,264 @@ source_filename = "main" @20 = private unnamed_addr constant [17 x i8] c"C1 I1(i1) was nil", align 1 @21 = private unnamed_addr constant [4 x i8] c"pass", align 1 -define void @main.C1.f(%main.C1 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1.f"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1" %0) { _llgo_0: ret void } -define void @"main.(*C1).f"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C1).f"(ptr %0) { _llgo_0: - %1 = load %main.C1, ptr %0, align 1 - call void @main.C1.f(%main.C1 %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1", ptr %0, align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1.f"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1" %1) ret void } -define void @main.C2.f(%main.C2 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2.f"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2" %0) { _llgo_0: ret void } -define void @main.C2.g(%main.C2 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2.g"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2" %0) { _llgo_0: ret void } -define void @"main.(*C2).f"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C2).f"(ptr %0) { _llgo_0: - %1 = load %main.C2, ptr %0, align 1 - call void @main.C2.f(%main.C2 %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2", ptr %0, align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2.f"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2" %1) ret void } -define void @"main.(*C2).g"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C2).g"(ptr %0) { _llgo_0: - %1 = load %main.C2, ptr %0, align 1 - call void @main.C2.g(%main.C2 %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2", ptr %0, align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2.g"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2" %1) ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @_llgo_main.I0, align 8 - %3 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %2, ptr null) - br i1 %3, label %_llgo_23, label %_llgo_24 + %0 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I0", align 8 + %1 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %0, ptr null) + br i1 %1, label %_llgo_23, label %_llgo_24 _llgo_1: ; preds = %_llgo_25 - %4 = load ptr, ptr @_llgo_string, align 8 - %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 21 }, ptr %5, align 8 - %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr %5, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %7) + %2 = load ptr, ptr @_llgo_string, align 8 + %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 21 }, ptr %3, align 8 + %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %4, ptr %3, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %5) unreachable _llgo_2: ; preds = %_llgo_25 - %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) - %9 = load ptr, ptr @_llgo_main.I1, align 8 - %10 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %9, ptr %8) - br i1 %10, label %_llgo_26, label %_llgo_27 + %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) + %7 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I1", align 8 + %8 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %7, ptr %6) + br i1 %8, label %_llgo_26, label %_llgo_27 _llgo_3: ; preds = %_llgo_28 - %11 = load ptr, ptr @_llgo_string, align 8 - %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 21 }, ptr %12, align 8 - %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %11, 0 - %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, ptr %12, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %14) + %9 = load ptr, ptr @_llgo_string, align 8 + %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 21 }, ptr %10, align 8 + %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %9, 0 + %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %11, ptr %10, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %12) unreachable _llgo_4: ; preds = %_llgo_28 - %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) - %16 = load ptr, ptr @_llgo_main.I2, align 8 - %17 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %16, ptr %15) - br i1 %17, label %_llgo_29, label %_llgo_30 + %13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) + %14 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I2", align 8 + %15 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %14, ptr %13) + br i1 %15, label %_llgo_29, label %_llgo_30 _llgo_5: ; preds = %_llgo_31 - %18 = load ptr, ptr @_llgo_string, align 8 - %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 21 }, ptr %19, align 8 - %20 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %18, 0 - %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %20, ptr %19, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %21) + %16 = load ptr, ptr @_llgo_string, align 8 + %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 21 }, ptr %17, align 8 + %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %16, 0 + %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %18, ptr %17, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %19) unreachable _llgo_6: ; preds = %_llgo_31 - %22 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) - %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %22, 0 - %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %23, ptr null, 1 - %25 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) - %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %25, 0 - %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %26, ptr null, 1 - %28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) - %29 = load ptr, ptr @"main.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 - %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %29, ptr %28) - %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %30, 0 - %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %31, ptr null, 1 - %33 = load ptr, ptr @_llgo_main.C1, align 8 - %34 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) - store %main.C1 zeroinitializer, ptr %34, align 1 - %35 = load ptr, ptr @"main.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 - %36 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %35, ptr %33) - %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %36, 0 - %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %37, ptr %34, 1 - %39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %38) - %40 = load ptr, ptr @_llgo_main.I0, align 8 - %41 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %40, ptr %39) - br i1 %41, label %_llgo_32, label %_llgo_33 + %20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) + %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %20, 0 + %22 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %21, ptr null, 1 + %23 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) + %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %23, 0 + %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %24, ptr null, 1 + %26 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) + %27 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 + %28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %27, ptr %26) + %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %28, 0 + %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %29, ptr null, 1 + %31 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1", align 8 + %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) + store %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1" zeroinitializer, ptr %32, align 1 + %33 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 + %34 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %33, ptr %31) + %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %34, 0 + %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %35, ptr %32, 1 + %37 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %36) + %38 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I0", align 8 + %39 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %38, ptr %37) + br i1 %39, label %_llgo_32, label %_llgo_33 _llgo_7: ; preds = %_llgo_34 - %42 = load ptr, ptr @_llgo_string, align 8 - %43 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 17 }, ptr %43, align 8 - %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %42, 0 - %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %44, ptr %43, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %45) + %40 = load ptr, ptr @_llgo_string, align 8 + %41 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 17 }, ptr %41, align 8 + %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %40, 0 + %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %42, ptr %41, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %43) unreachable _llgo_8: ; preds = %_llgo_34 - %46 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %38) - %47 = load ptr, ptr @_llgo_main.I1, align 8 - %48 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %47, ptr %46) - br i1 %48, label %_llgo_35, label %_llgo_36 + %44 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %36) + %45 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I1", align 8 + %46 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %45, ptr %44) + br i1 %46, label %_llgo_35, label %_llgo_36 _llgo_9: ; preds = %_llgo_37 - %49 = load ptr, ptr @_llgo_string, align 8 - %50 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 17 }, ptr %50, align 8 - %51 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %49, 0 - %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %51, ptr %50, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %52) + %47 = load ptr, ptr @_llgo_string, align 8 + %48 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 17 }, ptr %48, align 8 + %49 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %47, 0 + %50 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %49, ptr %48, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %50) unreachable _llgo_10: ; preds = %_llgo_37 - %53 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %38) - %54 = load ptr, ptr @_llgo_main.I2, align 8 - %55 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %54, ptr %53) - br i1 %55, label %_llgo_38, label %_llgo_39 + %51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %36) + %52 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I2", align 8 + %53 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %52, ptr %51) + br i1 %53, label %_llgo_38, label %_llgo_39 _llgo_11: ; preds = %_llgo_40 - %56 = load ptr, ptr @_llgo_string, align 8 - %57 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 20 }, ptr %57, align 8 - %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %56, 0 - %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %58, ptr %57, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %59) + %54 = load ptr, ptr @_llgo_string, align 8 + %55 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 20 }, ptr %55, align 8 + %56 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %54, 0 + %57 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %56, ptr %55, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %57) unreachable _llgo_12: ; preds = %_llgo_40 - %60 = load ptr, ptr @_llgo_main.C2, align 8 - %61 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) - store %main.C2 zeroinitializer, ptr %61, align 1 - %62 = load ptr, ptr @"main.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 - %63 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %62, ptr %60) - %64 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %63, 0 - %65 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %64, ptr %61, 1 - %66 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %65) - %67 = load ptr, ptr @_llgo_main.I0, align 8 - %68 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %67, ptr %66) - br i1 %68, label %_llgo_41, label %_llgo_42 + %58 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2", align 8 + %59 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) + store %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2" zeroinitializer, ptr %59, align 1 + %60 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 + %61 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %60, ptr %58) + %62 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %61, 0 + %63 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %62, ptr %59, 1 + %64 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %63) + %65 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I0", align 8 + %66 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %65, ptr %64) + br i1 %66, label %_llgo_41, label %_llgo_42 _llgo_13: ; preds = %_llgo_43 - %69 = load ptr, ptr @_llgo_string, align 8 - %70 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @16, i64 17 }, ptr %70, align 8 - %71 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %69, 0 - %72 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %71, ptr %70, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %72) + %67 = load ptr, ptr @_llgo_string, align 8 + %68 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @16, i64 17 }, ptr %68, align 8 + %69 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %67, 0 + %70 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %69, ptr %68, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %70) unreachable _llgo_14: ; preds = %_llgo_43 - %73 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %65) - %74 = load ptr, ptr @_llgo_main.I1, align 8 - %75 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %74, ptr %73) - br i1 %75, label %_llgo_44, label %_llgo_45 + %71 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %63) + %72 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I1", align 8 + %73 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %72, ptr %71) + br i1 %73, label %_llgo_44, label %_llgo_45 _llgo_15: ; preds = %_llgo_46 - %76 = load ptr, ptr @_llgo_string, align 8 - %77 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 17 }, ptr %77, align 8 - %78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %76, 0 - %79 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %78, ptr %77, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %79) + %74 = load ptr, ptr @_llgo_string, align 8 + %75 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 17 }, ptr %75, align 8 + %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %74, 0 + %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %76, ptr %75, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %77) unreachable _llgo_16: ; preds = %_llgo_46 - %80 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %65) - %81 = load ptr, ptr @_llgo_main.I2, align 8 - %82 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %81, ptr %80) - br i1 %82, label %_llgo_47, label %_llgo_48 + %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %63) + %79 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I2", align 8 + %80 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %79, ptr %78) + br i1 %80, label %_llgo_47, label %_llgo_48 _llgo_17: ; preds = %_llgo_49 - %83 = load ptr, ptr @_llgo_string, align 8 - %84 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @18, i64 17 }, ptr %84, align 8 - %85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %83, 0 - %86 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %85, ptr %84, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %86) + %81 = load ptr, ptr @_llgo_string, align 8 + %82 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @18, i64 17 }, ptr %82, align 8 + %83 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %81, 0 + %84 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %83, ptr %82, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %84) unreachable _llgo_18: ; preds = %_llgo_49 - %87 = load ptr, ptr @_llgo_main.C1, align 8 - %88 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) - store %main.C1 zeroinitializer, ptr %88, align 1 - %89 = load ptr, ptr @"main.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 - %90 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %89, ptr %87) - %91 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %90, 0 - %92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %91, ptr %88, 1 - %93 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %92) - %94 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %92, 1 - %95 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %93, 0 - %96 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %95, ptr %94, 1 - %97 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %96, %"github.com/goplus/llgo/runtime/internal/runtime.eface" zeroinitializer) - br i1 %97, label %_llgo_19, label %_llgo_20 + %85 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1", align 8 + %86 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) + store %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1" zeroinitializer, ptr %86, align 1 + %87 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 + %88 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %87, ptr %85) + %89 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %88, 0 + %90 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %89, ptr %86, 1 + %91 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %90) + %92 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %90, 1 + %93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %91, 0 + %94 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %93, ptr %92, 1 + %95 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %94, %"github.com/goplus/llgo/runtime/internal/runtime.eface" zeroinitializer) + br i1 %95, label %_llgo_19, label %_llgo_20 _llgo_19: ; preds = %_llgo_18 - %98 = load ptr, ptr @_llgo_string, align 8 - %99 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @19, i64 17 }, ptr %99, align 8 - %100 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %98, 0 - %101 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %100, ptr %99, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %101) + %96 = load ptr, ptr @_llgo_string, align 8 + %97 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @19, i64 17 }, ptr %97, align 8 + %98 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %96, 0 + %99 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %98, ptr %97, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %99) unreachable _llgo_20: ; preds = %_llgo_18 - %102 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %92) - %103 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %92, 1 - %104 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %102, 0 - %105 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %104, ptr %103, 1 - %106 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) - %107 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %106, 0 - %108 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %107, ptr null, 1 - %109 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %105, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %108) - br i1 %109, label %_llgo_21, label %_llgo_22 + %100 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %90) + %101 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %90, 1 + %102 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %100, 0 + %103 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %102, ptr %101, 1 + %104 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) + %105 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %104, 0 + %106 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %105, ptr null, 1 + %107 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %103, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %106) + br i1 %107, label %_llgo_21, label %_llgo_22 _llgo_21: ; preds = %_llgo_20 - %110 = load ptr, ptr @_llgo_string, align 8 - %111 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @20, i64 17 }, ptr %111, align 8 - %112 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %110, 0 - %113 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %112, ptr %111, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %113) + %108 = load ptr, ptr @_llgo_string, align 8 + %109 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @20, i64 17 }, ptr %109, align 8 + %110 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %108, 0 + %111 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %110, ptr %109, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %111) unreachable _llgo_22: ; preds = %_llgo_20 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @21, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void _llgo_23: ; preds = %_llgo_0 br label %_llgo_25 @@ -317,169 +311,167 @@ _llgo_24: ; preds = %_llgo_0 br label %_llgo_25 _llgo_25: ; preds = %_llgo_24, %_llgo_23 - %114 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } [ { %"github.com/goplus/llgo/runtime/internal/runtime.eface" zeroinitializer, i1 true }, %_llgo_23 ], [ zeroinitializer, %_llgo_24 ] - %115 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %114, 0 - %116 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %114, 1 - br i1 %116, label %_llgo_1, label %_llgo_2 + %112 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } [ { %"github.com/goplus/llgo/runtime/internal/runtime.eface" zeroinitializer, i1 true }, %_llgo_23 ], [ zeroinitializer, %_llgo_24 ] + %113 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %112, 0 + %114 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %112, 1 + br i1 %114, label %_llgo_1, label %_llgo_2 _llgo_26: ; preds = %_llgo_2 - %117 = load ptr, ptr @"main.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 - %118 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %117, ptr %8) - %119 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %118, 0 - %120 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %119, ptr null, 1 - %121 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %120, 0 - %122 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %121, i1 true, 1 + %115 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 + %116 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %115, ptr %6) + %117 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %116, 0 + %118 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %117, ptr null, 1 + %119 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %118, 0 + %120 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %119, i1 true, 1 br label %_llgo_28 _llgo_27: ; preds = %_llgo_2 br label %_llgo_28 _llgo_28: ; preds = %_llgo_27, %_llgo_26 - %123 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %122, %_llgo_26 ], [ zeroinitializer, %_llgo_27 ] - %124 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %123, 0 - %125 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %123, 1 - br i1 %125, label %_llgo_3, label %_llgo_4 + %121 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %120, %_llgo_26 ], [ zeroinitializer, %_llgo_27 ] + %122 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %121, 0 + %123 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %121, 1 + br i1 %123, label %_llgo_3, label %_llgo_4 _llgo_29: ; preds = %_llgo_4 - %126 = load ptr, ptr @"main.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw", align 8 - %127 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %126, ptr %15) - %128 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %127, 0 - %129 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %128, ptr null, 1 - %130 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %129, 0 - %131 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %130, i1 true, 1 + %124 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw", align 8 + %125 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %124, ptr %13) + %126 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %125, 0 + %127 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %126, ptr null, 1 + %128 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %127, 0 + %129 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %128, i1 true, 1 br label %_llgo_31 _llgo_30: ; preds = %_llgo_4 br label %_llgo_31 _llgo_31: ; preds = %_llgo_30, %_llgo_29 - %132 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %131, %_llgo_29 ], [ zeroinitializer, %_llgo_30 ] - %133 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %132, 0 - %134 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %132, 1 - br i1 %134, label %_llgo_5, label %_llgo_6 + %130 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %129, %_llgo_29 ], [ zeroinitializer, %_llgo_30 ] + %131 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %130, 0 + %132 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %130, 1 + br i1 %132, label %_llgo_5, label %_llgo_6 _llgo_32: ; preds = %_llgo_6 - %135 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %38, 1 - %136 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %39, 0 - %137 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %136, ptr %135, 1 - %138 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %137, 0 - %139 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %138, i1 true, 1 + %133 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %36, 1 + %134 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %37, 0 + %135 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %134, ptr %133, 1 + %136 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %135, 0 + %137 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %136, i1 true, 1 br label %_llgo_34 _llgo_33: ; preds = %_llgo_6 br label %_llgo_34 _llgo_34: ; preds = %_llgo_33, %_llgo_32 - %140 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } [ %139, %_llgo_32 ], [ zeroinitializer, %_llgo_33 ] - %141 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %140, 0 - %142 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %140, 1 - br i1 %142, label %_llgo_8, label %_llgo_7 + %138 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } [ %137, %_llgo_32 ], [ zeroinitializer, %_llgo_33 ] + %139 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %138, 0 + %140 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %138, 1 + br i1 %140, label %_llgo_8, label %_llgo_7 _llgo_35: ; preds = %_llgo_8 - %143 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %38, 1 - %144 = load ptr, ptr @"main.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 - %145 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %144, ptr %46) - %146 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %145, 0 - %147 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %146, ptr %143, 1 - %148 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %147, 0 - %149 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %148, i1 true, 1 + %141 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %36, 1 + %142 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 + %143 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %142, ptr %44) + %144 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %143, 0 + %145 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %144, ptr %141, 1 + %146 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %145, 0 + %147 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %146, i1 true, 1 br label %_llgo_37 _llgo_36: ; preds = %_llgo_8 br label %_llgo_37 _llgo_37: ; preds = %_llgo_36, %_llgo_35 - %150 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %149, %_llgo_35 ], [ zeroinitializer, %_llgo_36 ] - %151 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %150, 0 - %152 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %150, 1 - br i1 %152, label %_llgo_10, label %_llgo_9 + %148 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %147, %_llgo_35 ], [ zeroinitializer, %_llgo_36 ] + %149 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %148, 0 + %150 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %148, 1 + br i1 %150, label %_llgo_10, label %_llgo_9 _llgo_38: ; preds = %_llgo_10 - %153 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %38, 1 - %154 = load ptr, ptr @"main.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw", align 8 - %155 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %154, ptr %53) - %156 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %155, 0 - %157 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %156, ptr %153, 1 - %158 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %157, 0 - %159 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %158, i1 true, 1 + %151 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %36, 1 + %152 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw", align 8 + %153 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %152, ptr %51) + %154 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %153, 0 + %155 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %154, ptr %151, 1 + %156 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %155, 0 + %157 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %156, i1 true, 1 br label %_llgo_40 _llgo_39: ; preds = %_llgo_10 br label %_llgo_40 _llgo_40: ; preds = %_llgo_39, %_llgo_38 - %160 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %159, %_llgo_38 ], [ zeroinitializer, %_llgo_39 ] - %161 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %160, 0 - %162 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %160, 1 - br i1 %162, label %_llgo_11, label %_llgo_12 + %158 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %157, %_llgo_38 ], [ zeroinitializer, %_llgo_39 ] + %159 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %158, 0 + %160 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %158, 1 + br i1 %160, label %_llgo_11, label %_llgo_12 _llgo_41: ; preds = %_llgo_12 - %163 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %65, 1 - %164 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %66, 0 - %165 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %164, ptr %163, 1 - %166 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %165, 0 - %167 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %166, i1 true, 1 + %161 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %63, 1 + %162 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %64, 0 + %163 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %162, ptr %161, 1 + %164 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %163, 0 + %165 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %164, i1 true, 1 br label %_llgo_43 _llgo_42: ; preds = %_llgo_12 br label %_llgo_43 _llgo_43: ; preds = %_llgo_42, %_llgo_41 - %168 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } [ %167, %_llgo_41 ], [ zeroinitializer, %_llgo_42 ] - %169 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %168, 0 - %170 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %168, 1 - br i1 %170, label %_llgo_14, label %_llgo_13 + %166 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } [ %165, %_llgo_41 ], [ zeroinitializer, %_llgo_42 ] + %167 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %166, 0 + %168 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.eface", i1 } %166, 1 + br i1 %168, label %_llgo_14, label %_llgo_13 _llgo_44: ; preds = %_llgo_14 - %171 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %65, 1 - %172 = load ptr, ptr @"main.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 - %173 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %172, ptr %73) - %174 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %173, 0 - %175 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %174, ptr %171, 1 - %176 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %175, 0 - %177 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %176, i1 true, 1 + %169 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %63, 1 + %170 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 + %171 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %170, ptr %71) + %172 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %171, 0 + %173 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %172, ptr %169, 1 + %174 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %173, 0 + %175 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %174, i1 true, 1 br label %_llgo_46 _llgo_45: ; preds = %_llgo_14 br label %_llgo_46 _llgo_46: ; preds = %_llgo_45, %_llgo_44 - %178 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %177, %_llgo_44 ], [ zeroinitializer, %_llgo_45 ] - %179 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %178, 0 - %180 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %178, 1 - br i1 %180, label %_llgo_16, label %_llgo_15 + %176 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %175, %_llgo_44 ], [ zeroinitializer, %_llgo_45 ] + %177 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %176, 0 + %178 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %176, 1 + br i1 %178, label %_llgo_16, label %_llgo_15 _llgo_47: ; preds = %_llgo_16 - %181 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %65, 1 - %182 = load ptr, ptr @"main.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw", align 8 - %183 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %182, ptr %80) - %184 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %183, 0 - %185 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %184, ptr %181, 1 - %186 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %185, 0 - %187 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %186, i1 true, 1 + %179 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %63, 1 + %180 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw", align 8 + %181 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %180, ptr %78) + %182 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %181, 0 + %183 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %182, ptr %179, 1 + %184 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %183, 0 + %185 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %184, i1 true, 1 br label %_llgo_49 _llgo_48: ; preds = %_llgo_16 br label %_llgo_49 _llgo_49: ; preds = %_llgo_48, %_llgo_47 - %188 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %187, %_llgo_47 ], [ zeroinitializer, %_llgo_48 ] - %189 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %188, 0 - %190 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %188, 1 - br i1 %190, label %_llgo_18, label %_llgo_17 + %186 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %185, %_llgo_47 ], [ zeroinitializer, %_llgo_48 ] + %187 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %186, 0 + %188 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %186, 1 + br i1 %188, label %_llgo_18, label %_llgo_17 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 2 }) - %1 = load ptr, ptr @_llgo_main.I0, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 2 }) + %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I0", align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %0, ptr @_llgo_main.I0, align 8 + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I0", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 @@ -504,13 +496,13 @@ _llgo_5: ; preds = %_llgo_4 br label %_llgo_6 _llgo_6: ; preds = %_llgo_5, %_llgo_4 - %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 2 }) - %11 = load ptr, ptr @_llgo_main.I1, align 8 + %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 2 }) + %11 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I1", align 8 %12 = icmp eq ptr %11, null br i1 %12, label %_llgo_7, label %_llgo_8 _llgo_7: ; preds = %_llgo_6 - store ptr %10, ptr @_llgo_main.I1, align 8 + store ptr %10, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I1", align 8 br label %_llgo_8 _llgo_8: ; preds = %_llgo_7, %_llgo_6 @@ -537,7 +529,7 @@ _llgo_10: ; preds = %_llgo_9, %_llgo_8 br i1 %12, label %_llgo_11, label %_llgo_12 _llgo_11: ; preds = %_llgo_10 - %25 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 6 }, ptr undef }, ptr %24, 1 + %25 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 54 }, ptr undef }, ptr %24, 1 %26 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) %27 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %26, i64 0 store %"github.com/goplus/llgo/runtime/abi.Imethod" %25, ptr %27, align 8 @@ -549,22 +541,22 @@ _llgo_11: ; preds = %_llgo_10 _llgo_12: ; preds = %_llgo_11, %_llgo_10 %31 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 - %32 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 6 }, ptr undef }, ptr %31, 1 + %32 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 54 }, ptr undef }, ptr %31, 1 %33 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) %34 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %33, i64 0 store %"github.com/goplus/llgo/runtime/abi.Imethod" %32, ptr %34, align 8 %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %33, 0 %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35, i64 1, 1 %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36, i64 1, 2 - %38 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37) - store ptr %38, ptr @"main.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 - %39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 2 }) - %40 = load ptr, ptr @_llgo_main.I2, align 8 + %38 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37) + store ptr %38, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8 + %39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 2 }) + %40 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I2", align 8 %41 = icmp eq ptr %40, null br i1 %41, label %_llgo_13, label %_llgo_14 _llgo_13: ; preds = %_llgo_12 - store ptr %39, ptr @_llgo_main.I2, align 8 + store ptr %39, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.I2", align 8 br label %_llgo_14 _llgo_14: ; preds = %_llgo_13, %_llgo_12 @@ -573,8 +565,8 @@ _llgo_14: ; preds = %_llgo_13, %_llgo_12 br i1 %41, label %_llgo_15, label %_llgo_16 _llgo_15: ; preds = %_llgo_14 - %44 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 6 }, ptr undef }, ptr %42, 1 - %45 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 6 }, ptr undef }, ptr %43, 1 + %44 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 54 }, ptr undef }, ptr %42, 1 + %45 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 54 }, ptr undef }, ptr %43, 1 %46 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) %47 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %46, i64 0 store %"github.com/goplus/llgo/runtime/abi.Imethod" %44, ptr %47, align 8 @@ -589,8 +581,8 @@ _llgo_15: ; preds = %_llgo_14 _llgo_16: ; preds = %_llgo_15, %_llgo_14 %52 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %53 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 - %54 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 6 }, ptr undef }, ptr %52, 1 - %55 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 6 }, ptr undef }, ptr %53, 1 + %54 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 54 }, ptr undef }, ptr %52, 1 + %55 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 54 }, ptr undef }, ptr %53, 1 %56 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) %57 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %56, i64 0 store %"github.com/goplus/llgo/runtime/abi.Imethod" %54, ptr %57, align 8 @@ -599,15 +591,15 @@ _llgo_16: ; preds = %_llgo_15, %_llgo_14 %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %56, 0 %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59, i64 2, 1 %61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, i64 2, 2 - %62 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61) - store ptr %62, ptr @"main.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw", align 8 - %63 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 2 }, i64 25, i64 0, i64 1, i64 1) - %64 = load ptr, ptr @_llgo_main.C1, align 8 + %62 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61) + store ptr %62, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw", align 8 + %63 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 2 }, i64 25, i64 0, i64 1, i64 1) + %64 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1", align 8 %65 = icmp eq ptr %64, null br i1 %65, label %_llgo_17, label %_llgo_18 _llgo_17: ; preds = %_llgo_16 - store ptr %63, ptr @_llgo_main.C1, align 8 + store ptr %63, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1", align 8 br label %_llgo_18 _llgo_18: ; preds = %_llgo_17, %_llgo_16 @@ -615,19 +607,19 @@ _llgo_18: ; preds = %_llgo_17, %_llgo_16 %67 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %66, 0 %68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %67, i64 0, 1 %69 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68, i64 0, 2 - %70 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %69) + %70 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %69) store ptr %70, ptr @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw", align 8 %71 = load ptr, ptr @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw", align 8 br i1 %65, label %_llgo_19, label %_llgo_20 _llgo_19: ; preds = %_llgo_18 %72 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 - %73 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %72, 1 - %74 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %73, ptr @"main.(*C1).f", 2 - %75 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %74, ptr @"main.(*C1).f", 3 - %76 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %72, 1 - %77 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %76, ptr @"main.(*C1).f", 2 - %78 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %77, ptr @main.C1.f, 3 + %73 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 54 }, ptr undef, ptr undef, ptr undef }, ptr %72, 1 + %74 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %73, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C1).f", 2 + %75 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %74, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C1).f", 3 + %76 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 54 }, ptr undef, ptr undef, ptr undef }, ptr %72, 1 + %77 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %76, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C1).f", 2 + %78 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %77, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C1.f", 3 %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %80 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %79, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %78, ptr %80, align 8 @@ -644,13 +636,13 @@ _llgo_19: ; preds = %_llgo_18 br label %_llgo_20 _llgo_20: ; preds = %_llgo_19, %_llgo_18 - %89 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 2 }, i64 25, i64 0, i64 2, i64 2) - %90 = load ptr, ptr @_llgo_main.C2, align 8 + %89 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 2 }, i64 25, i64 0, i64 2, i64 2) + %90 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2", align 8 %91 = icmp eq ptr %90, null br i1 %91, label %_llgo_21, label %_llgo_22 _llgo_21: ; preds = %_llgo_20 - store ptr %89, ptr @_llgo_main.C2, align 8 + store ptr %89, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2", align 8 br label %_llgo_22 _llgo_22: ; preds = %_llgo_21, %_llgo_20 @@ -659,19 +651,19 @@ _llgo_22: ; preds = %_llgo_21, %_llgo_20 _llgo_23: ; preds = %_llgo_22 %93 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 - %94 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %93, 1 - %95 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %94, ptr @"main.(*C2).f", 2 - %96 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %95, ptr @"main.(*C2).f", 3 - %97 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %93, 1 - %98 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %97, ptr @"main.(*C2).f", 2 - %99 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %98, ptr @main.C2.f, 3 + %94 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 54 }, ptr undef, ptr undef, ptr undef }, ptr %93, 1 + %95 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %94, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C2).f", 2 + %96 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %95, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C2).f", 3 + %97 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 54 }, ptr undef, ptr undef, ptr undef }, ptr %93, 1 + %98 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %97, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C2).f", 2 + %99 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %98, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2.f", 3 %100 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 - %101 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %100, 1 - %102 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %101, ptr @"main.(*C2).g", 2 - %103 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %102, ptr @"main.(*C2).g", 3 - %104 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %100, 1 - %105 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %104, ptr @"main.(*C2).g", 2 - %106 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %105, ptr @main.C2.g, 3 + %101 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 54 }, ptr undef, ptr undef, ptr undef }, ptr %100, 1 + %102 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %101, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C2).g", 2 + %103 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %102, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C2).g", 3 + %104 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 54 }, ptr undef, ptr undef, ptr undef }, ptr %100, 1 + %105 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %104, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.(*C2).g", 2 + %106 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %105, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceconv.C2.g", 3 %107 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 80) %108 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %107, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %99, ptr %108, align 8 diff --git a/compiler/cl/_testgo/ifaceprom/out.ll b/compiler/cl/_testgo/ifaceprom/out.ll index a37ba385..067af013 100644 --- a/compiler/cl/_testgo/ifaceprom/out.ll +++ b/compiler/cl/_testgo/ifaceprom/out.ll @@ -1,43 +1,41 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom" -%main.S = type { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } +%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S" = type { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.impl = type {} +%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl" = type {} %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } %"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [3 x i8] c"two", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -@_llgo_main.impl = linkonce global ptr null, align 8 -@1 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl" = linkonce global ptr null, align 8 +@1 = private unnamed_addr constant [52 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom", align 1 @2 = private unnamed_addr constant [4 x i8] c"impl", align 1 @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw" = linkonce global ptr null, align 8 @3 = private unnamed_addr constant [3 x i8] c"one", align 1 -@4 = private unnamed_addr constant [8 x i8] c"main.one", align 1 +@4 = private unnamed_addr constant [56 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.one", align 1 @_llgo_int = linkonce global ptr null, align 8 @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA" = linkonce global ptr null, align 8 -@5 = private unnamed_addr constant [8 x i8] c"main.two", align 1 +@5 = private unnamed_addr constant [56 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.two", align 1 @_llgo_string = linkonce global ptr null, align 8 @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to" = linkonce global ptr null, align 8 -@"main.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA" = linkonce global ptr null, align 8 -@_llgo_main.I = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.I" = linkonce global ptr null, align 8 @6 = private unnamed_addr constant [1 x i8] c"I", align 1 @7 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 @8 = private unnamed_addr constant [4 x i8] c"pass", align 1 -define i64 @main.S.one(%main.S %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S.one"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S" %0) { _llgo_0: - %1 = alloca %main.S, align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", align 8 call void @llvm.memset(ptr %1, i8 0, i64 16, i1 false) - store %main.S %0, ptr %1, align 8 - %2 = getelementptr inbounds %main.S, ptr %1, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S" %0, ptr %1, align 8 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %1, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %2, align 8 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %3) %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %3, 0 @@ -51,12 +49,12 @@ _llgo_0: ret i64 %12 } -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @main.S.two(%main.S %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S.two"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S" %0) { _llgo_0: - %1 = alloca %main.S, align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", align 8 call void @llvm.memset(ptr %1, i8 0, i64 16, i1 false) - store %main.S %0, ptr %1, align 8 - %2 = getelementptr inbounds %main.S, ptr %1, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S" %0, ptr %1, align 8 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %1, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %2, align 8 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %3) %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %3, 0 @@ -70,9 +68,9 @@ _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.String" %12 } -define i64 @"main.(*S).one"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*S).one"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.S, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, i32 0, i32 0 %2 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %1, align 8 %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %2) %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2, 0 @@ -86,9 +84,9 @@ _llgo_0: ret i64 %11 } -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"main.(*S).two"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*S).two"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.S, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, i32 0, i32 0 %2 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %1, align 8 %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %2) %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2, 0 @@ -102,329 +100,325 @@ _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.String" %11 } -define i64 @main.impl.one(%main.impl %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl.one"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl" %0) { _llgo_0: ret i64 1 } -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @main.impl.two(%main.impl %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl.two"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl" %0) { _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 } } -define i64 @"main.(*impl).one"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*impl).one"(ptr %0) { _llgo_0: - %1 = load %main.impl, ptr %0, align 1 - %2 = call i64 @main.impl.one(%main.impl %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl", ptr %0, align 1 + %2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl.one"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl" %1) ret i64 %2 } -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"main.(*impl).two"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*impl).two"(ptr %0) { _llgo_0: - %1 = load %main.impl, ptr %0, align 1 - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @main.impl.two(%main.impl %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl", ptr %0, align 1 + %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl.two"(%"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl" %1) ret %"github.com/goplus/llgo/runtime/internal/runtime.String" %2 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = alloca %main.S, align 8 - call void @llvm.memset(ptr %2, i8 0, i64 16, i1 false) - %3 = getelementptr inbounds %main.S, ptr %2, i32 0, i32 0 - %4 = load ptr, ptr @_llgo_main.impl, align 8 - %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) - store %main.impl zeroinitializer, ptr %5, align 1 - %6 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 - %7 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 - %8 = load ptr, ptr @"main.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 - %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %8, ptr %4) - %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %9, 0 - %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %10, ptr %5, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %11, ptr %3, align 8 - %12 = getelementptr inbounds %main.S, ptr %2, i32 0, i32 0 - %13 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %12, align 8 - %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %13) - %15 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %13, 0 - %16 = getelementptr ptr, ptr %15, i64 3 - %17 = load ptr, ptr %16, align 8 - %18 = insertvalue { ptr, ptr } undef, ptr %17, 0 - %19 = insertvalue { ptr, ptr } %18, ptr %14, 1 - %20 = extractvalue { ptr, ptr } %19, 1 - %21 = extractvalue { ptr, ptr } %19, 0 - %22 = call i64 %21(ptr %20) - %23 = icmp ne i64 %22, 1 - br i1 %23, label %_llgo_1, label %_llgo_2 + %0 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", align 8 + call void @llvm.memset(ptr %0, i8 0, i64 16, i1 false) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, i32 0, i32 0 + %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl", align 8 + %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) + store %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl" zeroinitializer, ptr %3, align 1 + %4 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 + %5 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 + %6 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 + %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %6, ptr %2) + %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %7, 0 + %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %8, ptr %3, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %9, ptr %1, align 8 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, i32 0, i32 0 + %11 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %10, align 8 + %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %11) + %13 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %11, 0 + %14 = getelementptr ptr, ptr %13, i64 3 + %15 = load ptr, ptr %14, align 8 + %16 = insertvalue { ptr, ptr } undef, ptr %15, 0 + %17 = insertvalue { ptr, ptr } %16, ptr %12, 1 + %18 = extractvalue { ptr, ptr } %17, 1 + %19 = extractvalue { ptr, ptr } %17, 0 + %20 = call i64 %19(ptr %18) + %21 = icmp ne i64 %20, 1 + br i1 %21, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %24 = load ptr, ptr @_llgo_int, align 8 - %25 = inttoptr i64 %22 to ptr - %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %24, 0 - %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %26, ptr %25, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %27) + %22 = load ptr, ptr @_llgo_int, align 8 + %23 = inttoptr i64 %20 to ptr + %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %22, 0 + %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %24, ptr %23, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %25) unreachable _llgo_2: ; preds = %_llgo_0 - %28 = load %main.S, ptr %2, align 8 - %29 = extractvalue %main.S %28, 0 - %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %29) - %31 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %29, 0 - %32 = getelementptr ptr, ptr %31, i64 3 - %33 = load ptr, ptr %32, align 8 - %34 = insertvalue { ptr, ptr } undef, ptr %33, 0 - %35 = insertvalue { ptr, ptr } %34, ptr %30, 1 - %36 = extractvalue { ptr, ptr } %35, 1 - %37 = extractvalue { ptr, ptr } %35, 0 - %38 = call i64 %37(ptr %36) - %39 = icmp ne i64 %38, 1 - br i1 %39, label %_llgo_3, label %_llgo_4 + %26 = load %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, align 8 + %27 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S" %26, 0 + %28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %27) + %29 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %27, 0 + %30 = getelementptr ptr, ptr %29, i64 3 + %31 = load ptr, ptr %30, align 8 + %32 = insertvalue { ptr, ptr } undef, ptr %31, 0 + %33 = insertvalue { ptr, ptr } %32, ptr %28, 1 + %34 = extractvalue { ptr, ptr } %33, 1 + %35 = extractvalue { ptr, ptr } %33, 0 + %36 = call i64 %35(ptr %34) + %37 = icmp ne i64 %36, 1 + br i1 %37, label %_llgo_3, label %_llgo_4 _llgo_3: ; preds = %_llgo_2 - %40 = load ptr, ptr @_llgo_int, align 8 - %41 = inttoptr i64 %38 to ptr - %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %40, 0 - %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %42, ptr %41, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %43) + %38 = load ptr, ptr @_llgo_int, align 8 + %39 = inttoptr i64 %36 to ptr + %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %38, 0 + %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %40, ptr %39, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %41) unreachable _llgo_4: ; preds = %_llgo_2 - %44 = getelementptr inbounds %main.S, ptr %2, i32 0, i32 0 - %45 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %44, align 8 - %46 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %45) - %47 = load ptr, ptr @_llgo_main.I, align 8 - %48 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %47, ptr %46) - br i1 %48, label %_llgo_17, label %_llgo_18 + %42 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, i32 0, i32 0 + %43 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %42, align 8 + %44 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %43) + %45 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.I", align 8 + %46 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %45, ptr %44) + br i1 %46, label %_llgo_17, label %_llgo_18 _llgo_5: ; preds = %_llgo_17 - %49 = load ptr, ptr @_llgo_int, align 8 - %50 = inttoptr i64 %124 to ptr - %51 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %49, 0 - %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %51, ptr %50, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %52) + %47 = load ptr, ptr @_llgo_int, align 8 + %48 = inttoptr i64 %122 to ptr + %49 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %47, 0 + %50 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %49, ptr %48, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %50) unreachable _llgo_6: ; preds = %_llgo_17 - %53 = load %main.S, ptr %2, align 8 - %54 = extractvalue %main.S %53, 0 - %55 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %54) - %56 = load ptr, ptr @_llgo_main.I, align 8 - %57 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %56, ptr %55) - br i1 %57, label %_llgo_19, label %_llgo_20 + %51 = load %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, align 8 + %52 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S" %51, 0 + %53 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %52) + %54 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.I", align 8 + %55 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %54, ptr %53) + br i1 %55, label %_llgo_19, label %_llgo_20 _llgo_7: ; preds = %_llgo_19 - %58 = load ptr, ptr @_llgo_int, align 8 - %59 = inttoptr i64 %140 to ptr - %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %58, 0 - %61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %60, ptr %59, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %61) + %56 = load ptr, ptr @_llgo_int, align 8 + %57 = inttoptr i64 %138 to ptr + %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %56, 0 + %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %58, ptr %57, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %59) unreachable _llgo_8: ; preds = %_llgo_19 - %62 = getelementptr inbounds %main.S, ptr %2, i32 0, i32 0 - %63 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %62, align 8 - %64 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %63) - %65 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %63, 0 - %66 = getelementptr ptr, ptr %65, i64 4 - %67 = load ptr, ptr %66, align 8 - %68 = insertvalue { ptr, ptr } undef, ptr %67, 0 - %69 = insertvalue { ptr, ptr } %68, ptr %64, 1 - %70 = extractvalue { ptr, ptr } %69, 1 - %71 = extractvalue { ptr, ptr } %69, 0 - %72 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %71(ptr %70) - %73 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %72, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }) - %74 = xor i1 %73, true - br i1 %74, label %_llgo_9, label %_llgo_10 + %60 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, i32 0, i32 0 + %61 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %60, align 8 + %62 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %61) + %63 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %61, 0 + %64 = getelementptr ptr, ptr %63, i64 4 + %65 = load ptr, ptr %64, align 8 + %66 = insertvalue { ptr, ptr } undef, ptr %65, 0 + %67 = insertvalue { ptr, ptr } %66, ptr %62, 1 + %68 = extractvalue { ptr, ptr } %67, 1 + %69 = extractvalue { ptr, ptr } %67, 0 + %70 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %69(ptr %68) + %71 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %70, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }) + %72 = xor i1 %71, true + br i1 %72, label %_llgo_9, label %_llgo_10 _llgo_9: ; preds = %_llgo_8 - %75 = load ptr, ptr @_llgo_string, align 8 - %76 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" %72, ptr %76, align 8 - %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %75, 0 - %78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %77, ptr %76, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %78) + %73 = load ptr, ptr @_llgo_string, align 8 + %74 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" %70, ptr %74, align 8 + %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %73, 0 + %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %75, ptr %74, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %76) unreachable _llgo_10: ; preds = %_llgo_8 - %79 = load %main.S, ptr %2, align 8 - %80 = extractvalue %main.S %79, 0 - %81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %80) - %82 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %80, 0 - %83 = getelementptr ptr, ptr %82, i64 4 - %84 = load ptr, ptr %83, align 8 - %85 = insertvalue { ptr, ptr } undef, ptr %84, 0 - %86 = insertvalue { ptr, ptr } %85, ptr %81, 1 - %87 = extractvalue { ptr, ptr } %86, 1 - %88 = extractvalue { ptr, ptr } %86, 0 - %89 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %88(ptr %87) - %90 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %89, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }) - %91 = xor i1 %90, true - br i1 %91, label %_llgo_11, label %_llgo_12 + %77 = load %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, align 8 + %78 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S" %77, 0 + %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %78) + %80 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %78, 0 + %81 = getelementptr ptr, ptr %80, i64 4 + %82 = load ptr, ptr %81, align 8 + %83 = insertvalue { ptr, ptr } undef, ptr %82, 0 + %84 = insertvalue { ptr, ptr } %83, ptr %79, 1 + %85 = extractvalue { ptr, ptr } %84, 1 + %86 = extractvalue { ptr, ptr } %84, 0 + %87 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %86(ptr %85) + %88 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %87, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }) + %89 = xor i1 %88, true + br i1 %89, label %_llgo_11, label %_llgo_12 _llgo_11: ; preds = %_llgo_10 - %92 = load ptr, ptr @_llgo_string, align 8 - %93 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" %89, ptr %93, align 8 - %94 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %92, 0 - %95 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %94, ptr %93, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %95) + %90 = load ptr, ptr @_llgo_string, align 8 + %91 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" %87, ptr %91, align 8 + %92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %90, 0 + %93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %92, ptr %91, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %93) unreachable _llgo_12: ; preds = %_llgo_10 - %96 = getelementptr inbounds %main.S, ptr %2, i32 0, i32 0 - %97 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %96, align 8 - %98 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %97) - %99 = load ptr, ptr @_llgo_main.I, align 8 - %100 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %99, ptr %98) - br i1 %100, label %_llgo_21, label %_llgo_22 + %94 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, i32 0, i32 0 + %95 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %94, align 8 + %96 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %95) + %97 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.I", align 8 + %98 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %97, ptr %96) + br i1 %98, label %_llgo_21, label %_llgo_22 _llgo_13: ; preds = %_llgo_21 - %101 = load ptr, ptr @_llgo_string, align 8 - %102 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" %156, ptr %102, align 8 - %103 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %101, 0 - %104 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %103, ptr %102, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %104) + %99 = load ptr, ptr @_llgo_string, align 8 + %100 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" %154, ptr %100, align 8 + %101 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %99, 0 + %102 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %101, ptr %100, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %102) unreachable _llgo_14: ; preds = %_llgo_21 - %105 = load %main.S, ptr %2, align 8 - %106 = extractvalue %main.S %105, 0 - %107 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %106) - %108 = load ptr, ptr @_llgo_main.I, align 8 - %109 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %108, ptr %107) - br i1 %109, label %_llgo_23, label %_llgo_24 + %103 = load %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S", ptr %0, align 8 + %104 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.S" %103, 0 + %105 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %104) + %106 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.I", align 8 + %107 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %106, ptr %105) + br i1 %107, label %_llgo_23, label %_llgo_24 _llgo_15: ; preds = %_llgo_23 - %110 = load ptr, ptr @_llgo_string, align 8 - %111 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" %173, ptr %111, align 8 - %112 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %110, 0 - %113 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %112, ptr %111, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %113) + %108 = load ptr, ptr @_llgo_string, align 8 + %109 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" %171, ptr %109, align 8 + %110 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %108, 0 + %111 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %110, ptr %109, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %111) unreachable _llgo_16: ; preds = %_llgo_23 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void _llgo_17: ; preds = %_llgo_4 - %114 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %45, 1 - %115 = load ptr, ptr @"main.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 - %116 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %115, ptr %46) - %117 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %116, 0 - %118 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %117, ptr %114, 1 - %119 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - %120 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %119, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %45, ptr %120, align 8 - %121 = insertvalue { ptr, ptr } { ptr @"main.one$bound", ptr undef }, ptr %119, 1 - %122 = extractvalue { ptr, ptr } %121, 1 - %123 = extractvalue { ptr, ptr } %121, 0 - %124 = call i64 %123(ptr %122) - %125 = icmp ne i64 %124, 1 - br i1 %125, label %_llgo_5, label %_llgo_6 + %112 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %43, 1 + %113 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 + %114 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %113, ptr %44) + %115 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %114, 0 + %116 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %115, ptr %112, 1 + %117 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + %118 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %117, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %43, ptr %118, align 8 + %119 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.one$bound", ptr undef }, ptr %117, 1 + %120 = extractvalue { ptr, ptr } %119, 1 + %121 = extractvalue { ptr, ptr } %119, 0 + %122 = call i64 %121(ptr %120) + %123 = icmp ne i64 %122, 1 + br i1 %123, label %_llgo_5, label %_llgo_6 _llgo_18: ; preds = %_llgo_4 - %126 = load ptr, ptr @_llgo_string, align 8 - %127 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %127, align 8 - %128 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %126, 0 - %129 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %128, ptr %127, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %129) + %124 = load ptr, ptr @_llgo_string, align 8 + %125 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %125, align 8 + %126 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %124, 0 + %127 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %126, ptr %125, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %127) unreachable _llgo_19: ; preds = %_llgo_6 - %130 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %54, 1 - %131 = load ptr, ptr @"main.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 - %132 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %131, ptr %55) - %133 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %132, 0 - %134 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %133, ptr %130, 1 - %135 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - %136 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %135, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %54, ptr %136, align 8 - %137 = insertvalue { ptr, ptr } { ptr @"main.one$bound", ptr undef }, ptr %135, 1 - %138 = extractvalue { ptr, ptr } %137, 1 - %139 = extractvalue { ptr, ptr } %137, 0 - %140 = call i64 %139(ptr %138) - %141 = icmp ne i64 %140, 1 - br i1 %141, label %_llgo_7, label %_llgo_8 + %128 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %52, 1 + %129 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 + %130 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %129, ptr %53) + %131 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %130, 0 + %132 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %131, ptr %128, 1 + %133 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + %134 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %133, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %52, ptr %134, align 8 + %135 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.one$bound", ptr undef }, ptr %133, 1 + %136 = extractvalue { ptr, ptr } %135, 1 + %137 = extractvalue { ptr, ptr } %135, 0 + %138 = call i64 %137(ptr %136) + %139 = icmp ne i64 %138, 1 + br i1 %139, label %_llgo_7, label %_llgo_8 _llgo_20: ; preds = %_llgo_6 - %142 = load ptr, ptr @_llgo_string, align 8 - %143 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %143, align 8 - %144 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %142, 0 - %145 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %144, ptr %143, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %145) + %140 = load ptr, ptr @_llgo_string, align 8 + %141 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %141, align 8 + %142 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %140, 0 + %143 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %142, ptr %141, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %143) unreachable _llgo_21: ; preds = %_llgo_12 - %146 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %97, 1 - %147 = load ptr, ptr @"main.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 - %148 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %147, ptr %98) - %149 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %148, 0 - %150 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %149, ptr %146, 1 - %151 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - %152 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %151, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %97, ptr %152, align 8 - %153 = insertvalue { ptr, ptr } { ptr @"main.two$bound", ptr undef }, ptr %151, 1 - %154 = extractvalue { ptr, ptr } %153, 1 - %155 = extractvalue { ptr, ptr } %153, 0 - %156 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %155(ptr %154) - %157 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %156, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }) - %158 = xor i1 %157, true - br i1 %158, label %_llgo_13, label %_llgo_14 + %144 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %95, 1 + %145 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 + %146 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %145, ptr %96) + %147 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %146, 0 + %148 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %147, ptr %144, 1 + %149 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + %150 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %149, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %95, ptr %150, align 8 + %151 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.two$bound", ptr undef }, ptr %149, 1 + %152 = extractvalue { ptr, ptr } %151, 1 + %153 = extractvalue { ptr, ptr } %151, 0 + %154 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %153(ptr %152) + %155 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %154, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }) + %156 = xor i1 %155, true + br i1 %156, label %_llgo_13, label %_llgo_14 _llgo_22: ; preds = %_llgo_12 - %159 = load ptr, ptr @_llgo_string, align 8 - %160 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %160, align 8 - %161 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %159, 0 - %162 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %161, ptr %160, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %162) + %157 = load ptr, ptr @_llgo_string, align 8 + %158 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %158, align 8 + %159 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %157, 0 + %160 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %159, ptr %158, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %160) unreachable _llgo_23: ; preds = %_llgo_14 - %163 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %106, 1 - %164 = load ptr, ptr @"main.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 - %165 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %164, ptr %107) - %166 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %165, 0 - %167 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %166, ptr %163, 1 - %168 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - %169 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %168, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %106, ptr %169, align 8 - %170 = insertvalue { ptr, ptr } { ptr @"main.two$bound", ptr undef }, ptr %168, 1 - %171 = extractvalue { ptr, ptr } %170, 1 - %172 = extractvalue { ptr, ptr } %170, 0 - %173 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %172(ptr %171) - %174 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %173, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }) - %175 = xor i1 %174, true - br i1 %175, label %_llgo_15, label %_llgo_16 + %161 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %104, 1 + %162 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 + %163 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %162, ptr %105) + %164 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %163, 0 + %165 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %164, ptr %161, 1 + %166 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + %167 = getelementptr inbounds { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %166, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %104, ptr %167, align 8 + %168 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.two$bound", ptr undef }, ptr %166, 1 + %169 = extractvalue { ptr, ptr } %168, 1 + %170 = extractvalue { ptr, ptr } %168, 0 + %171 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" %170(ptr %169) + %172 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %171, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }) + %173 = xor i1 %172, true + br i1 %173, label %_llgo_15, label %_llgo_16 _llgo_24: ; preds = %_llgo_14 - %176 = load ptr, ptr @_llgo_string, align 8 - %177 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %177, align 8 - %178 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %176, 0 - %179 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %178, ptr %177, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %179) + %174 = load ptr, ptr @_llgo_string, align 8 + %175 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %175, align 8 + %176 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %174, 0 + %177 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %176, ptr %175, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %177) unreachable } @@ -433,17 +427,15 @@ declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0 declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface") -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 4 }, i64 25, i64 0, i64 2, i64 2) - store ptr %0, ptr @_llgo_main.impl, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 4 }, i64 25, i64 0, i64 2, i64 2) + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl", align 8 %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0) %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %1, 0 %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %2, i64 0, 1 %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %3, i64 0, 2 - %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %4) + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 52 }, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %4) store ptr %5, ptr @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw", align 8 %6 = load ptr, ptr @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw", align 8 %7 = load ptr, ptr @_llgo_int, align 8 @@ -480,12 +472,12 @@ _llgo_3: ; preds = %_llgo_2 _llgo_4: ; preds = %_llgo_3, %_llgo_2 %24 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 - %25 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 8 }, ptr undef, ptr undef, ptr undef }, ptr %24, 1 - %26 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %25, ptr @"main.(*impl).one", 2 - %27 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %26, ptr @"main.(*impl).one", 3 - %28 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 8 }, ptr undef, ptr undef, ptr undef }, ptr %24, 1 - %29 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %28, ptr @"main.(*impl).one", 2 - %30 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %29, ptr @main.impl.one, 3 + %25 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 56 }, ptr undef, ptr undef, ptr undef }, ptr %24, 1 + %26 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %25, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*impl).one", 2 + %27 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %26, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*impl).one", 3 + %28 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 56 }, ptr undef, ptr undef, ptr undef }, ptr %24, 1 + %29 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %28, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*impl).one", 2 + %30 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %29, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl.one", 3 %31 = load ptr, ptr @_llgo_string, align 8 %32 = icmp eq ptr %31, null br i1 %32, label %_llgo_5, label %_llgo_6 @@ -520,12 +512,12 @@ _llgo_7: ; preds = %_llgo_6 _llgo_8: ; preds = %_llgo_7, %_llgo_6 %48 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 - %49 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 8 }, ptr undef, ptr undef, ptr undef }, ptr %48, 1 - %50 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %49, ptr @"main.(*impl).two", 2 - %51 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %50, ptr @"main.(*impl).two", 3 - %52 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 8 }, ptr undef, ptr undef, ptr undef }, ptr %48, 1 - %53 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %52, ptr @"main.(*impl).two", 2 - %54 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %53, ptr @main.impl.two, 3 + %49 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 56 }, ptr undef, ptr undef, ptr undef }, ptr %48, 1 + %50 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %49, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*impl).two", 2 + %51 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %50, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*impl).two", 3 + %52 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 56 }, ptr undef, ptr undef, ptr undef }, ptr %48, 1 + %53 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %52, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.(*impl).two", 2 + %54 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %53, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.impl.two", 3 %55 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 80) %56 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %55, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %30, ptr %56, align 8 @@ -545,8 +537,8 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_6 call void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr %0, ptr %6, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %66) %67 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %68 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 - %69 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 8 }, ptr undef }, ptr %67, 1 - %70 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 8 }, ptr undef }, ptr %68, 1 + %69 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 56 }, ptr undef }, ptr %67, 1 + %70 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 56 }, ptr undef }, ptr %68, 1 %71 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) %72 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %71, i64 0 store %"github.com/goplus/llgo/runtime/abi.Imethod" %69, ptr %72, align 8 @@ -555,15 +547,15 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_6 %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %71, 0 %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %74, i64 2, 1 %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75, i64 2, 2 - %77 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76) - store ptr %77, ptr @"main.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 - %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 1 }) - %79 = load ptr, ptr @_llgo_main.I, align 8 + %77 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76) + store ptr %77, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8 + %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 1 }) + %79 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.I", align 8 %80 = icmp eq ptr %79, null br i1 %80, label %_llgo_9, label %_llgo_10 _llgo_9: ; preds = %_llgo_8 - store ptr %78, ptr @_llgo_main.I, align 8 + store ptr %78, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.I", align 8 br label %_llgo_10 _llgo_10: ; preds = %_llgo_9, %_llgo_8 @@ -572,8 +564,8 @@ _llgo_10: ; preds = %_llgo_9, %_llgo_8 br i1 %80, label %_llgo_11, label %_llgo_12 _llgo_11: ; preds = %_llgo_10 - %83 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 8 }, ptr undef }, ptr %81, 1 - %84 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 8 }, ptr undef }, ptr %82, 1 + %83 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 56 }, ptr undef }, ptr %81, 1 + %84 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 56 }, ptr undef }, ptr %82, 1 %85 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) %86 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %85, i64 0 store %"github.com/goplus/llgo/runtime/abi.Imethod" %83, ptr %86, align 8 @@ -619,7 +611,7 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamedInterfac declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr, ptr) -define i64 @"main.one$bound"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.one$bound"(ptr %0) { _llgo_0: %1 = load { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %0, align 8 %2 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %1, 0 @@ -637,7 +629,7 @@ _llgo_0: declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.String") -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"main.two$bound"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testgo/ifaceprom.two$bound"(ptr %0) { _llgo_0: %1 = load { %"github.com/goplus/llgo/runtime/internal/runtime.iface" }, ptr %0, align 8 %2 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %1, 0 diff --git a/compiler/cl/_testgo/interface/out.ll b/compiler/cl/_testgo/interface/out.ll index 96ea0a5c..39597c8e 100644 --- a/compiler/cl/_testgo/interface/out.ll +++ b/compiler/cl/_testgo/interface/out.ll @@ -1,7 +1,7 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/interface' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/interface" -%main.Game1 = type { ptr } +%"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1" = type { ptr } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } @@ -10,11 +10,9 @@ source_filename = "main" %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -@_llgo_main.Game1 = linkonce global ptr null, align 8 -@0 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/interface.init$guard" = global i1 false, align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1" = linkonce global ptr null, align 8 +@0 = private unnamed_addr constant [52 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/interface", align 1 @1 = private unnamed_addr constant [5 x i8] c"Game1", align 1 @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Game" = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [48 x i8] c"github.com/goplus/llgo/compiler/cl/_testdata/foo", align 1 @@ -26,166 +24,162 @@ source_filename = "main" @6 = private unnamed_addr constant [57 x i8] c"github.com/goplus/llgo/compiler/cl/_testdata/foo.initGame", align 1 @"*_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Game" = linkonce global ptr null, align 8 @"_llgo_struct$8pZiNl4ZxK-lZr-eyXOGJ2lgSsNDx-SmrHiChs0Nc-o" = linkonce global ptr null, align 8 -@"*_llgo_main.Game1" = linkonce global ptr null, align 8 -@_llgo_main.Game2 = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game2" = linkonce global ptr null, align 8 @7 = private unnamed_addr constant [5 x i8] c"Game2", align 1 -@8 = private unnamed_addr constant [13 x i8] c"main.initGame", align 1 -@"*_llgo_main.Game2" = linkonce global ptr null, align 8 +@8 = private unnamed_addr constant [61 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/interface.initGame", align 1 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game2" = linkonce global ptr null, align 8 @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Gamer" = linkonce global ptr null, align 8 @9 = private unnamed_addr constant [5 x i8] c"Gamer", align 1 -@"main.iface$sO8a1LvuUsjXwiwaC6sR9-L4DiYgiOnZi7iosyShJXg" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/interface.iface$sO8a1LvuUsjXwiwaC6sR9-L4DiYgiOnZi7iosyShJXg" = linkonce global ptr null, align 8 @10 = private unnamed_addr constant [2 x i8] c"OK", align 1 @11 = private unnamed_addr constant [4 x i8] c"FAIL", align 1 -define void @main.Game1.Load(%main.Game1 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1.Load"(%"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1" %0) { _llgo_0: - %1 = alloca %main.Game1, align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", align 8 call void @llvm.memset(ptr %1, i8 0, i64 8, i1 false) - store %main.Game1 %0, ptr %1, align 8 - %2 = getelementptr inbounds %main.Game1, ptr %1, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1" %0, ptr %1, align 8 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", ptr %1, i32 0, i32 0 %3 = load ptr, ptr %2, align 8 call void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.(*Game).Load"(ptr %3) ret void } -define void @main.Game1.initGame(%main.Game1 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1.initGame"(%"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1" %0) { _llgo_0: - %1 = alloca %main.Game1, align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", align 8 call void @llvm.memset(ptr %1, i8 0, i64 8, i1 false) - store %main.Game1 %0, ptr %1, align 8 - %2 = getelementptr inbounds %main.Game1, ptr %1, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1" %0, ptr %1, align 8 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", ptr %1, i32 0, i32 0 %3 = load ptr, ptr %2, align 8 call void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.(*Game).initGame"(ptr %3) ret void } -define void @"main.(*Game1).Load"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/interface.(*Game1).Load"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.Game1, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", ptr %0, i32 0, i32 0 %2 = load ptr, ptr %1, align 8 call void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.(*Game).Load"(ptr %2) ret void } -define void @"main.(*Game1).initGame"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/interface.(*Game1).initGame"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.Game1, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", ptr %0, i32 0, i32 0 %2 = load ptr, ptr %1, align 8 call void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.(*Game).initGame"(ptr %2) ret void } -define void @"main.(*Game2).initGame"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/interface.(*Game2).initGame"(ptr %0) { _llgo_0: ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/interface.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.init$guard", align 1 call void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init"() - call void @"main.init$after"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/interface.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/interface.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %3 = getelementptr inbounds %main.Game1, ptr %2, i32 0, i32 0 - %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 0) - store ptr %4, ptr %3, align 8 - %5 = load ptr, ptr @_llgo_main.Game1, align 8 - %6 = load ptr, ptr @"*_llgo_main.Game1", align 8 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %6, 0 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr %2, 1 - %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 0) - %10 = load ptr, ptr @_llgo_main.Game2, align 8 - %11 = load ptr, ptr @"*_llgo_main.Game2", align 8 - %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %11, 0 - %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %12, ptr %9, 1 - %14 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, 0 - %15 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Gamer", align 8 - %16 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %15, ptr %14) - br i1 %16, label %_llgo_3, label %_llgo_4 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", ptr %0, i32 0, i32 0 + %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 0) + store ptr %2, ptr %1, align 8 + %3 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", align 8 + %4 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", align 8 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr %0, 1 + %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 0) + %8 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game2", align 8 + %9 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game2", align 8 + %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %9, 0 + %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, ptr %7, 1 + %12 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, 0 + %13 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Gamer", align 8 + %14 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %13, ptr %12) + br i1 %14, label %_llgo_3, label %_llgo_4 _llgo_1: ; preds = %_llgo_5 - %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %36) - %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %36, 0 - %19 = getelementptr ptr, ptr %18, i64 3 - %20 = load ptr, ptr %19, align 8 - %21 = insertvalue { ptr, ptr } undef, ptr %20, 0 - %22 = insertvalue { ptr, ptr } %21, ptr %17, 1 - %23 = extractvalue { ptr, ptr } %22, 1 - %24 = extractvalue { ptr, ptr } %22, 0 - call void %24(ptr %23) + %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %34) + %16 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %34, 0 + %17 = getelementptr ptr, ptr %16, i64 3 + %18 = load ptr, ptr %17, align 8 + %19 = insertvalue { ptr, ptr } undef, ptr %18, 0 + %20 = insertvalue { ptr, ptr } %19, ptr %15, 1 + %21 = extractvalue { ptr, ptr } %20, 1 + %22 = extractvalue { ptr, ptr } %20, 0 + call void %22(ptr %21) br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_5 - %25 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, 0 - %26 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Gamer", align 8 - %27 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %26, ptr %25) - br i1 %27, label %_llgo_6, label %_llgo_7 + %23 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %11, 0 + %24 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Gamer", align 8 + %25 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %24, ptr %23) + br i1 %25, label %_llgo_6, label %_llgo_7 _llgo_3: ; preds = %_llgo_0 - %28 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, 1 - %29 = load ptr, ptr @"main.iface$sO8a1LvuUsjXwiwaC6sR9-L4DiYgiOnZi7iosyShJXg", align 8 - %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %29, ptr %14) - %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %30, 0 - %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %31, ptr %28, 1 - %33 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %32, 0 - %34 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %33, i1 true, 1 + %26 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, 1 + %27 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.iface$sO8a1LvuUsjXwiwaC6sR9-L4DiYgiOnZi7iosyShJXg", align 8 + %28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %27, ptr %12) + %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %28, 0 + %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %29, ptr %26, 1 + %31 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %30, 0 + %32 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %31, i1 true, 1 br label %_llgo_5 _llgo_4: ; preds = %_llgo_0 br label %_llgo_5 _llgo_5: ; preds = %_llgo_4, %_llgo_3 - %35 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %34, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ] - %36 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %35, 0 - %37 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %35, 1 + %33 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %32, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ] + %34 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %33, 0 + %35 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %33, 1 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 2 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %36) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %34) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %37) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %35) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - br i1 %37, label %_llgo_1, label %_llgo_2 + br i1 %35, label %_llgo_1, label %_llgo_2 _llgo_6: ; preds = %_llgo_2 - %38 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, 1 - %39 = load ptr, ptr @"main.iface$sO8a1LvuUsjXwiwaC6sR9-L4DiYgiOnZi7iosyShJXg", align 8 - %40 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %39, ptr %25) - %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %40, 0 - %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %41, ptr %38, 1 - %43 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %42, 0 - %44 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %43, i1 true, 1 + %36 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %11, 1 + %37 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.iface$sO8a1LvuUsjXwiwaC6sR9-L4DiYgiOnZi7iosyShJXg", align 8 + %38 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %37, ptr %23) + %39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %38, 0 + %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %39, ptr %36, 1 + %41 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %40, 0 + %42 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %41, i1 true, 1 br label %_llgo_8 _llgo_7: ; preds = %_llgo_2 br label %_llgo_8 _llgo_8: ; preds = %_llgo_7, %_llgo_6 - %45 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %44, %_llgo_6 ], [ zeroinitializer, %_llgo_7 ] - %46 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %45, 0 - %47 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %45, 1 + %43 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } [ %42, %_llgo_6 ], [ zeroinitializer, %_llgo_7 ] + %44 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %43, 0 + %45 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.iface", i1 } %43, 1 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %46) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %44) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %47) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %45) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) @@ -197,20 +191,18 @@ declare void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.(*Game).initGame declare void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/interface.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, i64 25, i64 8, i64 2, i64 2) - %1 = load ptr, ptr @_llgo_main.Game1, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, i64 25, i64 8, i64 2, i64 2) + %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %0) - store ptr %0, ptr @_llgo_main.Game1, align 8 + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 @@ -228,7 +220,7 @@ _llgo_4: ; preds = %_llgo_3, %_llgo_2 %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %6, 0 %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 0, 1 %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 0, 2 - %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) + %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) store ptr %10, ptr @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw", align 8 %11 = load ptr, ptr @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw", align 8 br i1 %5, label %_llgo_5, label %_llgo_6 @@ -296,7 +288,7 @@ _llgo_10: ; preds = %_llgo_9, %_llgo_6 %48 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %46, 0 %49 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %48, i64 1, 1 %50 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %49, i64 1, 2 - %51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %50) + %51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %50) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %51) store ptr %51, ptr @"_llgo_struct$8pZiNl4ZxK-lZr-eyXOGJ2lgSsNDx-SmrHiChs0Nc-o", align 8 %52 = load ptr, ptr @"_llgo_struct$8pZiNl4ZxK-lZr-eyXOGJ2lgSsNDx-SmrHiChs0Nc-o", align 8 @@ -305,11 +297,11 @@ _llgo_10: ; preds = %_llgo_9, %_llgo_6 _llgo_11: ; preds = %_llgo_10 %53 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %54 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %53, 1 - %55 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %54, ptr @"main.(*Game1).Load", 2 - %56 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %55, ptr @"main.(*Game1).Load", 3 + %55 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %54, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.(*Game1).Load", 2 + %56 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %55, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.(*Game1).Load", 3 %57 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %53, 1 - %58 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %57, ptr @"main.(*Game1).Load", 2 - %59 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %58, ptr @main.Game1.Load, 3 + %58 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %57, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.(*Game1).Load", 2 + %59 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %58, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1.Load", 3 %60 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %61 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 57 }, ptr undef, ptr undef, ptr undef }, ptr %60, 1 %62 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %61, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.(*Game).initGame", 2 @@ -332,25 +324,25 @@ _llgo_11: ; preds = %_llgo_10 br label %_llgo_12 _llgo_12: ; preds = %_llgo_11, %_llgo_10 - %75 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, i64 25, i64 8, i64 2, i64 2) - %76 = load ptr, ptr @"*_llgo_main.Game1", align 8 + %75 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, i64 25, i64 8, i64 2, i64 2) + %76 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", align 8 %77 = icmp eq ptr %76, null br i1 %77, label %_llgo_13, label %_llgo_14 _llgo_13: ; preds = %_llgo_12 %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %75) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %78) - store ptr %78, ptr @"*_llgo_main.Game1", align 8 + store ptr %78, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game1", align 8 br label %_llgo_14 _llgo_14: ; preds = %_llgo_13, %_llgo_12 - %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 5 }, i64 25, i64 0, i64 0, i64 1) - %80 = load ptr, ptr @_llgo_main.Game2, align 8 + %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 5 }, i64 25, i64 0, i64 0, i64 1) + %80 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game2", align 8 %81 = icmp eq ptr %80, null br i1 %81, label %_llgo_15, label %_llgo_16 _llgo_15: ; preds = %_llgo_14 - store ptr %79, ptr @_llgo_main.Game2, align 8 + store ptr %79, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game2", align 8 br label %_llgo_16 _llgo_16: ; preds = %_llgo_15, %_llgo_14 @@ -359,9 +351,9 @@ _llgo_16: ; preds = %_llgo_15, %_llgo_14 _llgo_17: ; preds = %_llgo_16 %83 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 - %84 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 13 }, ptr undef, ptr undef, ptr undef }, ptr %83, 1 - %85 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %84, ptr @"main.(*Game2).initGame", 2 - %86 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %85, ptr @"main.(*Game2).initGame", 3 + %84 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 61 }, ptr undef, ptr undef, ptr undef }, ptr %83, 1 + %85 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %84, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.(*Game2).initGame", 2 + %86 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %85, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.(*Game2).initGame", 3 %87 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %88 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %87, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %86, ptr %88, align 8 @@ -372,15 +364,15 @@ _llgo_17: ; preds = %_llgo_16 br label %_llgo_18 _llgo_18: ; preds = %_llgo_17, %_llgo_16 - %92 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 5 }, i64 25, i64 0, i64 0, i64 1) - %93 = load ptr, ptr @"*_llgo_main.Game2", align 8 + %92 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 5 }, i64 25, i64 0, i64 0, i64 1) + %93 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game2", align 8 %94 = icmp eq ptr %93, null br i1 %94, label %_llgo_19, label %_llgo_20 _llgo_19: ; preds = %_llgo_18 %95 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %92) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %95) - store ptr %95, ptr @"*_llgo_main.Game2", align 8 + store ptr %95, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/interface.Game2", align 8 br label %_llgo_20 _llgo_20: ; preds = %_llgo_19, %_llgo_18 @@ -425,8 +417,8 @@ _llgo_24: ; preds = %_llgo_23, %_llgo_22 %116 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %113, 0 %117 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %116, i64 2, 1 %118 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %117, i64 2, 2 - %119 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %118) - store ptr %119, ptr @"main.iface$sO8a1LvuUsjXwiwaC6sR9-L4DiYgiOnZi7iosyShJXg", align 8 + %119 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %118) + store ptr %119, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/interface.iface$sO8a1LvuUsjXwiwaC6sR9-L4DiYgiOnZi7iosyShJXg", align 8 ret void } diff --git a/compiler/cl/_testgo/invoke/out.ll b/compiler/cl/_testgo/invoke/out.ll index dbca6334..d61ca64e 100644 --- a/compiler/cl/_testgo/invoke/out.ll +++ b/compiler/cl/_testgo/invoke/out.ll @@ -1,10 +1,10 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/invoke' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/invoke" -%main.T = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } +%"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.T5 = type { i64 } -%main.T6 = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5" = type { i64 } +%"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } @@ -12,7 +12,7 @@ source_filename = "main" %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } %"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/invoke.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [6 x i8] c"invoke", align 1 @1 = private unnamed_addr constant [7 x i8] c"invoke1", align 1 @2 = private unnamed_addr constant [7 x i8] c"invoke2", align 1 @@ -20,14 +20,12 @@ source_filename = "main" @4 = private unnamed_addr constant [7 x i8] c"invoke4", align 1 @5 = private unnamed_addr constant [7 x i8] c"invoke5", align 1 @6 = private unnamed_addr constant [7 x i8] c"invoke6", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @7 = private unnamed_addr constant [5 x i8] c"hello", align 1 -@_llgo_main.T = linkonce global ptr null, align 8 -@8 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T" = linkonce global ptr null, align 8 +@8 = private unnamed_addr constant [49 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/invoke", align 1 @9 = private unnamed_addr constant [1 x i8] c"T", align 1 @_llgo_string = linkonce global ptr null, align 8 -@"main.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/invoke.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ" = linkonce global ptr null, align 8 @10 = private unnamed_addr constant [1 x i8] c"s", align 1 @11 = private unnamed_addr constant [6 x i8] c"Invoke", align 1 @_llgo_int = linkonce global ptr null, align 8 @@ -35,47 +33,47 @@ source_filename = "main" @12 = private unnamed_addr constant [6 x i8] c"Method", align 1 @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac" = linkonce global ptr null, align 8 @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0" = linkonce global ptr null, align 8 -@"*_llgo_main.T" = linkonce global ptr null, align 8 -@_llgo_main.T1 = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1" = linkonce global ptr null, align 8 @13 = private unnamed_addr constant [2 x i8] c"T1", align 1 -@"*_llgo_main.T1" = linkonce global ptr null, align 8 -@_llgo_main.T2 = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2" = linkonce global ptr null, align 8 @14 = private unnamed_addr constant [2 x i8] c"T2", align 1 @_llgo_float64 = linkonce global ptr null, align 8 -@"*_llgo_main.T2" = linkonce global ptr null, align 8 -@_llgo_main.T3 = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T3" = linkonce global ptr null, align 8 @15 = private unnamed_addr constant [2 x i8] c"T3", align 1 @_llgo_int8 = linkonce global ptr null, align 8 -@"*_llgo_main.T3" = linkonce global ptr null, align 8 -@_llgo_main.T4 = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T3" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4" = linkonce global ptr null, align 8 @16 = private unnamed_addr constant [2 x i8] c"T4", align 1 @"[1]_llgo_int" = linkonce global ptr null, align 8 -@"*_llgo_main.T4" = linkonce global ptr null, align 8 -@_llgo_main.T5 = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5" = linkonce global ptr null, align 8 @17 = private unnamed_addr constant [2 x i8] c"T5", align 1 -@"main.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/invoke.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U" = linkonce global ptr null, align 8 @18 = private unnamed_addr constant [1 x i8] c"n", align 1 -@"*_llgo_main.T5" = linkonce global ptr null, align 8 -@_llgo_main.T6 = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6" = linkonce global ptr null, align 8 @19 = private unnamed_addr constant [2 x i8] c"T6", align 1 @_llgo_Pointer = linkonce global ptr null, align 8 -@"main.struct$TWlEC03isGYe2Nyy2HYnOBsOYR1lIx43oIUpIyqvm4s" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/invoke.struct$TWlEC03isGYe2Nyy2HYnOBsOYR1lIx43oIUpIyqvm4s" = linkonce global ptr null, align 8 @20 = private unnamed_addr constant [2 x i8] c"$f", align 1 @21 = private unnamed_addr constant [5 x i8] c"$data", align 1 -@"*_llgo_main.T6" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6" = linkonce global ptr null, align 8 @"_llgo_iface$jwmSdgh1zvY_TDIgLzCkvkbiyrdwl9N806DH0JGcyMI" = linkonce global ptr null, align 8 @22 = private unnamed_addr constant [5 x i8] c"world", align 1 -@_llgo_main.I = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.I" = linkonce global ptr null, align 8 @23 = private unnamed_addr constant [1 x i8] c"I", align 1 @24 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 @_llgo_any = linkonce global ptr null, align 8 -define i64 @main.T.Invoke(%main.T %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T.Invoke"(%"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T" %0) { _llgo_0: - %1 = alloca %main.T, align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 call void @llvm.memset(ptr %1, i8 0, i64 16, i1 false) - store %main.T %0, ptr %1, align 8 - %2 = getelementptr inbounds %main.T, ptr %1, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T" %0, ptr %1, align 8 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", ptr %1, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, align 8 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 6 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -84,19 +82,19 @@ _llgo_0: ret i64 0 } -define i64 @"main.(*T).Invoke"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T).Invoke"(ptr %0) { _llgo_0: - %1 = load %main.T, ptr %0, align 8 - %2 = call i64 @main.T.Invoke(%main.T %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", ptr %0, align 8 + %2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T.Invoke"(%"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T" %1) ret i64 %2 } -define void @"main.(*T).Method"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T).Method"(ptr %0) { _llgo_0: ret void } -define i64 @main.T1.Invoke(i64 %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1.Invoke"(i64 %0) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 7 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -105,14 +103,14 @@ _llgo_0: ret i64 1 } -define i64 @"main.(*T1).Invoke"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T1).Invoke"(ptr %0) { _llgo_0: %1 = load i64, ptr %0, align 4 - %2 = call i64 @main.T1.Invoke(i64 %1) + %2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1.Invoke"(i64 %1) ret i64 %2 } -define i64 @main.T2.Invoke(double %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2.Invoke"(double %0) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 7 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -121,14 +119,14 @@ _llgo_0: ret i64 2 } -define i64 @"main.(*T2).Invoke"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T2).Invoke"(ptr %0) { _llgo_0: %1 = load double, ptr %0, align 8 - %2 = call i64 @main.T2.Invoke(double %1) + %2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2.Invoke"(double %1) ret i64 %2 } -define i64 @"main.(*T3).Invoke"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T3).Invoke"(ptr %0) { _llgo_0: %1 = load i8, ptr %0, align 1 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 7 }) @@ -139,7 +137,7 @@ _llgo_0: ret i64 3 } -define i64 @main.T4.Invoke([1 x i64] %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4.Invoke"([1 x i64] %0) { _llgo_0: %1 = alloca [1 x i64], align 8 call void @llvm.memset(ptr %1, i8 0, i64 8, i1 false) @@ -153,19 +151,19 @@ _llgo_0: ret i64 4 } -define i64 @"main.(*T4).Invoke"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T4).Invoke"(ptr %0) { _llgo_0: %1 = load [1 x i64], ptr %0, align 4 - %2 = call i64 @main.T4.Invoke([1 x i64] %1) + %2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4.Invoke"([1 x i64] %1) ret i64 %2 } -define i64 @main.T5.Invoke(%main.T5 %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5.Invoke"(%"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5" %0) { _llgo_0: - %1 = alloca %main.T5, align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", align 8 call void @llvm.memset(ptr %1, i8 0, i64 8, i1 false) - store %main.T5 %0, ptr %1, align 4 - %2 = getelementptr inbounds %main.T5, ptr %1, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5" %0, ptr %1, align 4 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", ptr %1, i32 0, i32 0 %3 = load i64, ptr %2, align 4 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 7 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -174,17 +172,17 @@ _llgo_0: ret i64 5 } -define i64 @"main.(*T5).Invoke"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T5).Invoke"(ptr %0) { _llgo_0: - %1 = load %main.T5, ptr %0, align 4 - %2 = call i64 @main.T5.Invoke(%main.T5 %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", ptr %0, align 4 + %2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5.Invoke"(%"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5" %1) ret i64 %2 } -define i64 @main.T6.Invoke(%main.T6 %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6.Invoke"(%"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6" %0) { _llgo_0: - %1 = extractvalue %main.T6 %0, 1 - %2 = extractvalue %main.T6 %0, 0 + %1 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6" %0, 1 + %2 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6" %0, 0 %3 = call i64 %2(ptr %1) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 7 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -193,28 +191,28 @@ _llgo_0: ret i64 6 } -define i64 @"main.(*T6).Invoke"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T6).Invoke"(ptr %0) { _llgo_0: - %1 = load %main.T6, ptr %0, align 8 - %2 = call i64 @main.T6.Invoke(%main.T6 %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6", ptr %0, align 8 + %2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6.Invoke"(%"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6" %1) ret i64 %2 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) %2 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, 0 @@ -230,223 +228,219 @@ _llgo_0: ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %3 = getelementptr inbounds %main.T, ptr %2, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 5 }, ptr %3, align 8 - %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - store i64 100, ptr %4, align 4 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", ptr %0, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 5 }, ptr %1, align 8 + %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + store i64 100, ptr %2, align 4 + %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + store double 1.001000e+02, ptr %3, align 8 + %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 1) + store i8 127, ptr %4, align 1 %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - store double 1.001000e+02, ptr %5, align 8 - %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 1) - store i8 127, ptr %6, align 1 + %6 = getelementptr inbounds i64, ptr %5, i64 0 + store i64 200, ptr %6, align 4 %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %8 = getelementptr inbounds i64, ptr %7, i64 0 - store i64 200, ptr %8, align 4 - %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %10 = getelementptr inbounds %main.T5, ptr %9, i32 0, i32 0 - store i64 300, ptr %10, align 4 - %11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - store %main.T6 { ptr @"__llgo_stub.main.main$1", ptr null }, ptr %11, align 8 - %12 = load %main.T, ptr %2, align 8 - %13 = load ptr, ptr @_llgo_main.T, align 8 - %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %main.T %12, ptr %14, align 8 - %15 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 - %16 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %16, ptr %13) - %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %17, 0 - %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %18, ptr %14, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %19) - %20 = load ptr, ptr @"*_llgo_main.T", align 8 - %21 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %22 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %21, ptr %20) - %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %22, 0 - %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %23, ptr %2, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %24) - %25 = load i64, ptr %4, align 4 - %26 = load ptr, ptr @_llgo_main.T1, align 8 - %27 = inttoptr i64 %25 to ptr - %28 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %28, ptr %26) - %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %29, 0 - %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %30, ptr %27, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %31) - %32 = load ptr, ptr @"*_llgo_main.T1", align 8 - %33 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %34 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %33, ptr %32) - %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %34, 0 - %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %35, ptr %4, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %36) - %37 = load double, ptr %5, align 8 - %38 = load ptr, ptr @_llgo_main.T2, align 8 - %39 = bitcast double %37 to i64 - %40 = inttoptr i64 %39 to ptr - %41 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %42 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %41, ptr %38) - %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %42, 0 - %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %43, ptr %40, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %44) - %45 = load ptr, ptr @"*_llgo_main.T2", align 8 - %46 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %47 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %46, ptr %45) - %48 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %47, 0 - %49 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %48, ptr %5, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %49) - %50 = load ptr, ptr @_llgo_main.T3, align 8 - %51 = load ptr, ptr @"*_llgo_main.T3", align 8 - %52 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %53 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %52, ptr %51) - %54 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %53, 0 - %55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %54, ptr %6, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %55) - %56 = load [1 x i64], ptr %7, align 4 - %57 = load ptr, ptr @_llgo_main.T4, align 8 - %58 = extractvalue [1 x i64] %56, 0 - %59 = inttoptr i64 %58 to ptr - %60 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %61 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %60, ptr %57) - %62 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %61, 0 - %63 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %62, ptr %59, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %63) - %64 = load ptr, ptr @"*_llgo_main.T4", align 8 - %65 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %66 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %65, ptr %64) - %67 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %66, 0 - %68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %67, ptr %7, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %68) - %69 = load %main.T5, ptr %9, align 4 - %70 = load ptr, ptr @_llgo_main.T5, align 8 - %71 = extractvalue %main.T5 %69, 0 - %72 = inttoptr i64 %71 to ptr - %73 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %74 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %73, ptr %70) - %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %74, 0 - %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %75, ptr %72, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %76) - %77 = load ptr, ptr @"*_llgo_main.T5", align 8 - %78 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %78, ptr %77) - %80 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %79, 0 - %81 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %80, ptr %9, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %81) - %82 = load %main.T6, ptr %11, align 8 - %83 = load ptr, ptr @_llgo_main.T6, align 8 - %84 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %main.T6 %82, ptr %84, align 8 - %85 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %86 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %85, ptr %83) - %87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %86, 0 - %88 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %87, ptr %84, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %88) - %89 = load ptr, ptr @"*_llgo_main.T6", align 8 - %90 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %91 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %90, ptr %89) - %92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %91, 0 - %93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %92, ptr %11, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %93) - %94 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) - %95 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %96 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %95, ptr %94) - %97 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %96, 0 - %98 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %97, ptr null, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %98) + %8 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", ptr %7, i32 0, i32 0 + store i64 300, ptr %8, align 4 + %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + store %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6" { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/invoke.main$1", ptr null }, ptr %9, align 8 + %10 = load %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", ptr %0, align 8 + %11 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 + %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T" %10, ptr %12, align 8 + %13 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 + %14 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %14, ptr %11) + %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %15, 0 + %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %16, ptr %12, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %17) + %18 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 + %19 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %19, ptr %18) + %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %20, 0 + %22 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %21, ptr %0, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %22) + %23 = load i64, ptr %2, align 4 + %24 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1", align 8 + %25 = inttoptr i64 %23 to ptr + %26 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %27 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %26, ptr %24) + %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %27, 0 + %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %28, ptr %25, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %29) + %30 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1", align 8 + %31 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %31, ptr %30) + %33 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %32, 0 + %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %33, ptr %2, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %34) + %35 = load double, ptr %3, align 8 + %36 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2", align 8 + %37 = bitcast double %35 to i64 + %38 = inttoptr i64 %37 to ptr + %39 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %40 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %39, ptr %36) + %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %40, 0 + %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %41, ptr %38, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %42) + %43 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2", align 8 + %44 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %45 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %44, ptr %43) + %46 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %45, 0 + %47 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %46, ptr %3, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %47) + %48 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T3", align 8 + %49 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T3", align 8 + %50 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %50, ptr %49) + %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %51, 0 + %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %52, ptr %4, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %53) + %54 = load [1 x i64], ptr %5, align 4 + %55 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4", align 8 + %56 = extractvalue [1 x i64] %54, 0 + %57 = inttoptr i64 %56 to ptr + %58 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %59 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %58, ptr %55) + %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %59, 0 + %61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %60, ptr %57, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %61) + %62 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4", align 8 + %63 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %64 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %63, ptr %62) + %65 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %64, 0 + %66 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %65, ptr %5, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %66) + %67 = load %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", ptr %7, align 4 + %68 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", align 8 + %69 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5" %67, 0 + %70 = inttoptr i64 %69 to ptr + %71 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %72 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %71, ptr %68) + %73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %72, 0 + %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %73, ptr %70, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %74) + %75 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", align 8 + %76 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %77 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %76, ptr %75) + %78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %77, 0 + %79 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %78, ptr %7, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %79) + %80 = load %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6", ptr %9, align 8 + %81 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6", align 8 + %82 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6" %80, ptr %82, align 8 + %83 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %84 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %83, ptr %81) + %85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %84, 0 + %86 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %85, ptr %82, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %86) + %87 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6", align 8 + %88 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %89 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %88, ptr %87) + %90 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %89, 0 + %91 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %90, ptr %9, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %91) + %92 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) + %93 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %94 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %93, ptr %92) + %95 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %94, 0 + %96 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %95, ptr null, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %96) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %99 = load ptr, ptr @"*_llgo_main.T", align 8 - %100 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 - %101 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 - %102 = load ptr, ptr @"_llgo_iface$jwmSdgh1zvY_TDIgLzCkvkbiyrdwl9N806DH0JGcyMI", align 8 - %103 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %102, ptr %99) - %104 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %103, 0 - %105 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %104, ptr %2, 1 - %106 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %105) - %107 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %105, 1 - %108 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %109 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %108, ptr %106) - %110 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %109, 0 - %111 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %110, ptr %107, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %111) - %112 = alloca %main.T, align 8 - call void @llvm.memset(ptr %112, i8 0, i64 16, i1 false) - %113 = getelementptr inbounds %main.T, ptr %112, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @22, i64 5 }, ptr %113, align 8 - %114 = load %main.T, ptr %112, align 8 - %115 = load ptr, ptr @_llgo_main.T, align 8 - %116 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %main.T %114, ptr %116, align 8 - %117 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %115, 0 - %118 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %117, ptr %116, 1 - %119 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %118, 0 - %120 = load ptr, ptr @_llgo_main.I, align 8 - %121 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %120, ptr %119) - br i1 %121, label %_llgo_1, label %_llgo_2 + %97 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 + %98 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 + %99 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 + %100 = load ptr, ptr @"_llgo_iface$jwmSdgh1zvY_TDIgLzCkvkbiyrdwl9N806DH0JGcyMI", align 8 + %101 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %100, ptr %97) + %102 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %101, 0 + %103 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %102, ptr %0, 1 + %104 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %103) + %105 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %103, 1 + %106 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %107 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %106, ptr %104) + %108 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %107, 0 + %109 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %108, ptr %105, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %109) + %110 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 + call void @llvm.memset(ptr %110, i8 0, i64 16, i1 false) + %111 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", ptr %110, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @22, i64 5 }, ptr %111, align 8 + %112 = load %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", ptr %110, align 8 + %113 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 + %114 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T" %112, ptr %114, align 8 + %115 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %113, 0 + %116 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %115, ptr %114, 1 + %117 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %116, 0 + %118 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.I", align 8 + %119 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %118, ptr %117) + br i1 %119, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %122 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %118, 1 - %123 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %124 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %123, ptr %119) - %125 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %124, 0 - %126 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %125, ptr %122, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %126) - %127 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %118, 0 - %128 = load ptr, ptr @_llgo_any, align 8 - %129 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %128, ptr %127) - br i1 %129, label %_llgo_3, label %_llgo_4 + %120 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %116, 1 + %121 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %122 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %121, ptr %117) + %123 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %122, 0 + %124 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %123, ptr %120, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %124) + %125 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %116, 0 + %126 = load ptr, ptr @_llgo_any, align 8 + %127 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %126, ptr %125) + br i1 %127, label %_llgo_3, label %_llgo_4 _llgo_2: ; preds = %_llgo_0 - %130 = load ptr, ptr @_llgo_string, align 8 - %131 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @24, i64 21 }, ptr %131, align 8 - %132 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %130, 0 - %133 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %132, ptr %131, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %133) + %128 = load ptr, ptr @_llgo_string, align 8 + %129 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @24, i64 21 }, ptr %129, align 8 + %130 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %128, 0 + %131 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %130, ptr %129, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %131) unreachable _llgo_3: ; preds = %_llgo_1 - %134 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %118, 1 - %135 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %127, 0 - %136 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %135, ptr %134, 1 - %137 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %136, 0 - %138 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %139 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %138, ptr %137) - br i1 %139, label %_llgo_5, label %_llgo_6 + %132 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %116, 1 + %133 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %125, 0 + %134 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %133, ptr %132, 1 + %135 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %134, 0 + %136 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %137 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %136, ptr %135) + br i1 %137, label %_llgo_5, label %_llgo_6 _llgo_4: ; preds = %_llgo_1 - %140 = load ptr, ptr @_llgo_string, align 8 - %141 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @24, i64 21 }, ptr %141, align 8 - %142 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %140, 0 - %143 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %142, ptr %141, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %143) + %138 = load ptr, ptr @_llgo_string, align 8 + %139 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @24, i64 21 }, ptr %139, align 8 + %140 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %138, 0 + %141 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %140, ptr %139, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %141) unreachable _llgo_5: ; preds = %_llgo_3 - %144 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %136, 1 - %145 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 - %146 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %145, ptr %137) - %147 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %146, 0 - %148 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %147, ptr %144, 1 - call void @main.invoke(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %148) - ret i32 0 + %142 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %134, 1 + %143 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 + %144 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %143, ptr %135) + %145 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %144, 0 + %146 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %145, ptr %142, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.invoke"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %146) + ret void _llgo_6: ; preds = %_llgo_3 - %149 = load ptr, ptr @_llgo_string, align 8 - %150 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @24, i64 21 }, ptr %150, align 8 - %151 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %149, 0 - %152 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %151, ptr %150, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %152) + %147 = load ptr, ptr @_llgo_string, align 8 + %148 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @24, i64 21 }, ptr %148, align 8 + %149 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %147, 0 + %150 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %149, ptr %148, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %150) unreachable } -define i64 @"main.main$1"() { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.main$1"() { _llgo_0: ret i64 400 } @@ -464,25 +458,23 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(doubl declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface") -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define linkonce i64 @"__llgo_stub.main.main$1"(ptr %0) { +define linkonce i64 @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/invoke.main$1"(ptr %0) { _llgo_0: - %1 = tail call i64 @"main.main$1"() + %1 = tail call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.main$1"() ret i64 %1 } -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 16, i64 1, i64 2) - %1 = load ptr, ptr @_llgo_main.T, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 16, i64 1, i64 2) + %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %0, ptr @_llgo_main.T, align 8 + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 @@ -505,9 +497,9 @@ _llgo_4: ; preds = %_llgo_3, %_llgo_2 %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %9, 0 %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %11, i64 1, 1 %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %12, i64 1, 2 - %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %13) - store ptr %14, ptr @"main.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 - %15 = load ptr, ptr @"main.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 + %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %13) + store ptr %14, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 + %15 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 br i1 %2, label %_llgo_5, label %_llgo_6 _llgo_5: ; preds = %_llgo_4 @@ -552,11 +544,11 @@ _llgo_9: ; preds = %_llgo_8 _llgo_10: ; preds = %_llgo_9, %_llgo_8 %36 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %37 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %36, 1 - %38 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %37, ptr @"main.(*T).Invoke", 2 - %39 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %38, ptr @"main.(*T).Invoke", 3 + %38 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %37, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T).Invoke", 2 + %39 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %38, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T).Invoke", 3 %40 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %36, 1 - %41 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %40, ptr @"main.(*T).Invoke", 2 - %42 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %41, ptr @main.T.Invoke, 3 + %41 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %40, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T).Invoke", 2 + %42 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %41, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T.Invoke", 3 %43 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %44 = icmp eq ptr %43, null br i1 %44, label %_llgo_11, label %_llgo_12 @@ -578,8 +570,8 @@ _llgo_11: ; preds = %_llgo_10 _llgo_12: ; preds = %_llgo_11, %_llgo_10 %54 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %55 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %54, 1 - %56 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %55, ptr @"main.(*T).Method", 2 - %57 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %56, ptr @"main.(*T).Method", 3 + %56 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %55, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T).Method", 2 + %57 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %56, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T).Method", 3 %58 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %59 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %58, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %42, ptr %59, align 8 @@ -605,30 +597,30 @@ _llgo_13: ; preds = %_llgo_6 %72 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %70, 0 %73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %72, i64 1, 1 %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %73, i64 1, 2 - %75 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %74) + %75 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %74) store ptr %75, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8 br label %_llgo_14 _llgo_14: ; preds = %_llgo_13, %_llgo_6 - %76 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 16, i64 1, i64 2) - %77 = load ptr, ptr @"*_llgo_main.T", align 8 + %76 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 16, i64 1, i64 2) + %77 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 %78 = icmp eq ptr %77, null br i1 %78, label %_llgo_15, label %_llgo_16 _llgo_15: ; preds = %_llgo_14 %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %76) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %79) - store ptr %79, ptr @"*_llgo_main.T", align 8 + store ptr %79, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T", align 8 br label %_llgo_16 _llgo_16: ; preds = %_llgo_15, %_llgo_14 - %80 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 2 }, i64 2, i64 8, i64 1, i64 1) - %81 = load ptr, ptr @_llgo_main.T1, align 8 + %80 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 2 }, i64 2, i64 8, i64 1, i64 1) + %81 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1", align 8 %82 = icmp eq ptr %81, null br i1 %82, label %_llgo_17, label %_llgo_18 _llgo_17: ; preds = %_llgo_16 - store ptr %80, ptr @_llgo_main.T1, align 8 + store ptr %80, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1", align 8 br label %_llgo_18 _llgo_18: ; preds = %_llgo_17, %_llgo_16 @@ -638,11 +630,11 @@ _llgo_18: ; preds = %_llgo_17, %_llgo_16 _llgo_19: ; preds = %_llgo_18 %84 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %85 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %84, 1 - %86 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %85, ptr @"main.(*T1).Invoke", 2 - %87 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %86, ptr @"main.(*T1).Invoke", 3 + %86 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %85, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T1).Invoke", 2 + %87 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %86, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T1).Invoke", 3 %88 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %84, 1 - %89 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %88, ptr @"main.(*T1).Invoke", 2 - %90 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %89, ptr @main.T1.Invoke, 3 + %89 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %88, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T1).Invoke", 2 + %90 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %89, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1.Invoke", 3 %91 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %92 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %91, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %90, ptr %92, align 8 @@ -659,25 +651,25 @@ _llgo_19: ; preds = %_llgo_18 br label %_llgo_20 _llgo_20: ; preds = %_llgo_19, %_llgo_18 - %101 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 2 }, i64 2, i64 8, i64 1, i64 1) - %102 = load ptr, ptr @"*_llgo_main.T1", align 8 + %101 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 2 }, i64 2, i64 8, i64 1, i64 1) + %102 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1", align 8 %103 = icmp eq ptr %102, null br i1 %103, label %_llgo_21, label %_llgo_22 _llgo_21: ; preds = %_llgo_20 %104 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %101) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %104) - store ptr %104, ptr @"*_llgo_main.T1", align 8 + store ptr %104, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T1", align 8 br label %_llgo_22 _llgo_22: ; preds = %_llgo_21, %_llgo_20 - %105 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 2 }, i64 14, i64 8, i64 1, i64 1) - %106 = load ptr, ptr @_llgo_main.T2, align 8 + %105 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 2 }, i64 14, i64 8, i64 1, i64 1) + %106 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2", align 8 %107 = icmp eq ptr %106, null br i1 %107, label %_llgo_23, label %_llgo_24 _llgo_23: ; preds = %_llgo_22 - store ptr %105, ptr @_llgo_main.T2, align 8 + store ptr %105, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2", align 8 br label %_llgo_24 _llgo_24: ; preds = %_llgo_23, %_llgo_22 @@ -697,11 +689,11 @@ _llgo_26: ; preds = %_llgo_25, %_llgo_24 _llgo_27: ; preds = %_llgo_26 %112 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %113 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %112, 1 - %114 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %113, ptr @"main.(*T2).Invoke", 2 - %115 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %114, ptr @"main.(*T2).Invoke", 3 + %114 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %113, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T2).Invoke", 2 + %115 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %114, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T2).Invoke", 3 %116 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %112, 1 - %117 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %116, ptr @"main.(*T2).Invoke", 2 - %118 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %117, ptr @main.T2.Invoke, 3 + %117 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %116, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T2).Invoke", 2 + %118 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %117, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2.Invoke", 3 %119 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %120 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %119, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %118, ptr %120, align 8 @@ -718,25 +710,25 @@ _llgo_27: ; preds = %_llgo_26 br label %_llgo_28 _llgo_28: ; preds = %_llgo_27, %_llgo_26 - %129 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 2 }, i64 14, i64 8, i64 1, i64 1) - %130 = load ptr, ptr @"*_llgo_main.T2", align 8 + %129 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 2 }, i64 14, i64 8, i64 1, i64 1) + %130 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2", align 8 %131 = icmp eq ptr %130, null br i1 %131, label %_llgo_29, label %_llgo_30 _llgo_29: ; preds = %_llgo_28 %132 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %129) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %132) - store ptr %132, ptr @"*_llgo_main.T2", align 8 + store ptr %132, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T2", align 8 br label %_llgo_30 _llgo_30: ; preds = %_llgo_29, %_llgo_28 - %133 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 2 }, i64 3, i64 1, i64 0, i64 1) - %134 = load ptr, ptr @_llgo_main.T3, align 8 + %133 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 2 }, i64 3, i64 1, i64 0, i64 1) + %134 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T3", align 8 %135 = icmp eq ptr %134, null br i1 %135, label %_llgo_31, label %_llgo_32 _llgo_31: ; preds = %_llgo_30 - store ptr %133, ptr @_llgo_main.T3, align 8 + store ptr %133, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T3", align 8 br label %_llgo_32 _llgo_32: ; preds = %_llgo_31, %_llgo_30 @@ -756,8 +748,8 @@ _llgo_34: ; preds = %_llgo_33, %_llgo_32 _llgo_35: ; preds = %_llgo_34 %140 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %141 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %140, 1 - %142 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %141, ptr @"main.(*T3).Invoke", 2 - %143 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %142, ptr @"main.(*T3).Invoke", 3 + %142 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %141, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T3).Invoke", 2 + %143 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %142, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T3).Invoke", 3 %144 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %145 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %144, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %143, ptr %145, align 8 @@ -768,25 +760,25 @@ _llgo_35: ; preds = %_llgo_34 br label %_llgo_36 _llgo_36: ; preds = %_llgo_35, %_llgo_34 - %149 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 2 }, i64 3, i64 1, i64 0, i64 1) - %150 = load ptr, ptr @"*_llgo_main.T3", align 8 + %149 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 2 }, i64 3, i64 1, i64 0, i64 1) + %150 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T3", align 8 %151 = icmp eq ptr %150, null br i1 %151, label %_llgo_37, label %_llgo_38 _llgo_37: ; preds = %_llgo_36 %152 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %149) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %152) - store ptr %152, ptr @"*_llgo_main.T3", align 8 + store ptr %152, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T3", align 8 br label %_llgo_38 _llgo_38: ; preds = %_llgo_37, %_llgo_36 - %153 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @16, i64 2 }, i64 17, i64 8, i64 1, i64 1) - %154 = load ptr, ptr @_llgo_main.T4, align 8 + %153 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @16, i64 2 }, i64 17, i64 8, i64 1, i64 1) + %154 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4", align 8 %155 = icmp eq ptr %154, null br i1 %155, label %_llgo_39, label %_llgo_40 _llgo_39: ; preds = %_llgo_38 - store ptr %153, ptr @_llgo_main.T4, align 8 + store ptr %153, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4", align 8 br label %_llgo_40 _llgo_40: ; preds = %_llgo_39, %_llgo_38 @@ -807,11 +799,11 @@ _llgo_42: ; preds = %_llgo_41, %_llgo_40 _llgo_43: ; preds = %_llgo_42 %161 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %162 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %161, 1 - %163 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %162, ptr @"main.(*T4).Invoke", 2 - %164 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %163, ptr @"main.(*T4).Invoke", 3 + %163 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %162, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T4).Invoke", 2 + %164 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %163, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T4).Invoke", 3 %165 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %161, 1 - %166 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %165, ptr @"main.(*T4).Invoke", 2 - %167 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %166, ptr @main.T4.Invoke, 3 + %166 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %165, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T4).Invoke", 2 + %167 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %166, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4.Invoke", 3 %168 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %169 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %168, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %167, ptr %169, align 8 @@ -828,25 +820,25 @@ _llgo_43: ; preds = %_llgo_42 br label %_llgo_44 _llgo_44: ; preds = %_llgo_43, %_llgo_42 - %178 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @16, i64 2 }, i64 17, i64 8, i64 1, i64 1) - %179 = load ptr, ptr @"*_llgo_main.T4", align 8 + %178 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @16, i64 2 }, i64 17, i64 8, i64 1, i64 1) + %179 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4", align 8 %180 = icmp eq ptr %179, null br i1 %180, label %_llgo_45, label %_llgo_46 _llgo_45: ; preds = %_llgo_44 %181 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %178) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %181) - store ptr %181, ptr @"*_llgo_main.T4", align 8 + store ptr %181, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T4", align 8 br label %_llgo_46 _llgo_46: ; preds = %_llgo_45, %_llgo_44 - %182 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 2 }, i64 25, i64 8, i64 1, i64 1) - %183 = load ptr, ptr @_llgo_main.T5, align 8 + %182 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 2 }, i64 25, i64 8, i64 1, i64 1) + %183 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", align 8 %184 = icmp eq ptr %183, null br i1 %184, label %_llgo_47, label %_llgo_48 _llgo_47: ; preds = %_llgo_46 - store ptr %182, ptr @_llgo_main.T5, align 8 + store ptr %182, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", align 8 br label %_llgo_48 _llgo_48: ; preds = %_llgo_47, %_llgo_46 @@ -858,19 +850,19 @@ _llgo_48: ; preds = %_llgo_47, %_llgo_46 %189 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %187, 0 %190 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %189, i64 1, 1 %191 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %190, i64 1, 2 - %192 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %191) - store ptr %192, ptr @"main.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U", align 8 - %193 = load ptr, ptr @"main.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U", align 8 + %192 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %191) + store ptr %192, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U", align 8 + %193 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U", align 8 br i1 %184, label %_llgo_49, label %_llgo_50 _llgo_49: ; preds = %_llgo_48 %194 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %195 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %194, 1 - %196 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %195, ptr @"main.(*T5).Invoke", 2 - %197 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %196, ptr @"main.(*T5).Invoke", 3 + %196 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %195, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T5).Invoke", 2 + %197 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %196, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T5).Invoke", 3 %198 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %194, 1 - %199 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %198, ptr @"main.(*T5).Invoke", 2 - %200 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %199, ptr @main.T5.Invoke, 3 + %199 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %198, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T5).Invoke", 2 + %200 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %199, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5.Invoke", 3 %201 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %202 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %201, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %200, ptr %202, align 8 @@ -887,25 +879,25 @@ _llgo_49: ; preds = %_llgo_48 br label %_llgo_50 _llgo_50: ; preds = %_llgo_49, %_llgo_48 - %211 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 2 }, i64 25, i64 8, i64 1, i64 1) - %212 = load ptr, ptr @"*_llgo_main.T5", align 8 + %211 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 2 }, i64 25, i64 8, i64 1, i64 1) + %212 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", align 8 %213 = icmp eq ptr %212, null br i1 %213, label %_llgo_51, label %_llgo_52 _llgo_51: ; preds = %_llgo_50 %214 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %211) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %214) - store ptr %214, ptr @"*_llgo_main.T5", align 8 + store ptr %214, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T5", align 8 br label %_llgo_52 _llgo_52: ; preds = %_llgo_51, %_llgo_50 - %215 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @19, i64 2 }, i64 25, i64 24, i64 1, i64 1) - %216 = load ptr, ptr @_llgo_main.T6, align 8 + %215 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @19, i64 2 }, i64 25, i64 24, i64 1, i64 1) + %216 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6", align 8 %217 = icmp eq ptr %216, null br i1 %217, label %_llgo_53, label %_llgo_54 _llgo_53: ; preds = %_llgo_52 - store ptr %215, ptr @_llgo_main.T6, align 8 + store ptr %215, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6", align 8 br label %_llgo_54 _llgo_54: ; preds = %_llgo_53, %_llgo_52 @@ -945,19 +937,19 @@ _llgo_56: ; preds = %_llgo_55, %_llgo_54 %240 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %237, 0 %241 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %240, i64 2, 1 %242 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %241, i64 2, 2 - %243 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %242) - store ptr %243, ptr @"main.struct$TWlEC03isGYe2Nyy2HYnOBsOYR1lIx43oIUpIyqvm4s", align 8 - %244 = load ptr, ptr @"main.struct$TWlEC03isGYe2Nyy2HYnOBsOYR1lIx43oIUpIyqvm4s", align 8 + %243 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %242) + store ptr %243, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.struct$TWlEC03isGYe2Nyy2HYnOBsOYR1lIx43oIUpIyqvm4s", align 8 + %244 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.struct$TWlEC03isGYe2Nyy2HYnOBsOYR1lIx43oIUpIyqvm4s", align 8 br i1 %217, label %_llgo_57, label %_llgo_58 _llgo_57: ; preds = %_llgo_56 %245 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %246 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %245, 1 - %247 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %246, ptr @"main.(*T6).Invoke", 2 - %248 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %247, ptr @"main.(*T6).Invoke", 3 + %247 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %246, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T6).Invoke", 2 + %248 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %247, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T6).Invoke", 3 %249 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %245, 1 - %250 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %249, ptr @"main.(*T6).Invoke", 2 - %251 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %250, ptr @main.T6.Invoke, 3 + %250 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %249, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.(*T6).Invoke", 2 + %251 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %250, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6.Invoke", 3 %252 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %253 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %252, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %251, ptr %253, align 8 @@ -974,15 +966,15 @@ _llgo_57: ; preds = %_llgo_56 br label %_llgo_58 _llgo_58: ; preds = %_llgo_57, %_llgo_56 - %262 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @19, i64 2 }, i64 25, i64 24, i64 1, i64 1) - %263 = load ptr, ptr @"*_llgo_main.T6", align 8 + %262 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @19, i64 2 }, i64 25, i64 24, i64 1, i64 1) + %263 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6", align 8 %264 = icmp eq ptr %263, null br i1 %264, label %_llgo_59, label %_llgo_60 _llgo_59: ; preds = %_llgo_58 %265 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %262) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %265) - store ptr %265, ptr @"*_llgo_main.T6", align 8 + store ptr %265, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.T6", align 8 br label %_llgo_60 _llgo_60: ; preds = %_llgo_59, %_llgo_58 @@ -1003,18 +995,18 @@ _llgo_61: ; preds = %_llgo_60 %275 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %272, 0 %276 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %275, i64 2, 1 %277 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %276, i64 2, 2 - %278 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %277) + %278 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %277) store ptr %278, ptr @"_llgo_iface$jwmSdgh1zvY_TDIgLzCkvkbiyrdwl9N806DH0JGcyMI", align 8 br label %_llgo_62 _llgo_62: ; preds = %_llgo_61, %_llgo_60 - %279 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @23, i64 1 }) - %280 = load ptr, ptr @_llgo_main.I, align 8 + %279 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @23, i64 1 }) + %280 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.I", align 8 %281 = icmp eq ptr %280, null br i1 %281, label %_llgo_63, label %_llgo_64 _llgo_63: ; preds = %_llgo_62 - store ptr %279, ptr @_llgo_main.I, align 8 + store ptr %279, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/invoke.I", align 8 br label %_llgo_64 _llgo_64: ; preds = %_llgo_63, %_llgo_62 @@ -1042,7 +1034,7 @@ _llgo_67: ; preds = %_llgo_66 %292 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %291, 0 %293 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %292, i64 0, 1 %294 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %293, i64 0, 2 - %295 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %294) + %295 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %294) store ptr %295, ptr @_llgo_any, align 8 br label %_llgo_68 diff --git a/compiler/cl/_testgo/multiret/out.ll b/compiler/cl/_testgo/multiret/out.ll index 887bdbf1..aa3c4be9 100644 --- a/compiler/cl/_testgo/multiret/out.ll +++ b/compiler/cl/_testgo/multiret/out.ll @@ -1,51 +1,43 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/multiret' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/multiret" -@main.a = global i64 0, align 8 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/multiret.a" = global i64 0, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/multiret.init$guard" = global i1 false, align 1 -define { i64, double } @main.foo(double %0) { +define { i64, double } @"github.com/goplus/llgo/compiler/cl/_testgo/multiret.foo"(double %0) { _llgo_0: - %1 = load i64, ptr @main.a, align 4 + %1 = load i64, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/multiret.a", align 4 %2 = insertvalue { i64, double } undef, i64 %1, 0 %3 = insertvalue { i64, double } %2, double %0, 1 ret { i64, double } %3 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/multiret.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/multiret.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 - store i64 1, ptr @main.a, align 4 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/multiret.init$guard", align 1 + store i64 1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/multiret.a", align 4 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/multiret.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call { i64, double } @main.foo(double 2.000000e+00) - %3 = extractvalue { i64, double } %2, 0 - %4 = extractvalue { i64, double } %2, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %3) + %0 = call { i64, double } @"github.com/goplus/llgo/compiler/cl/_testgo/multiret.foo"(double 2.000000e+00) + %1 = extractvalue { i64, double } %0, 0 + %2 = extractvalue { i64, double } %0, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %1) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %4) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %2) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testgo/print/out.ll b/compiler/cl/_testgo/print/out.ll index adc3887e..8a15e13b 100644 --- a/compiler/cl/_testgo/print/out.ll +++ b/compiler/cl/_testgo/print/out.ll @@ -1,38 +1,30 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/print' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/print" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/print.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/print.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/print.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/print.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/print.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 46) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 46) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testgo/reader/out.ll b/compiler/cl/_testgo/reader/out.ll index a9b92c20..5f947312 100644 --- a/compiler/cl/_testgo/reader/out.ll +++ b/compiler/cl/_testgo/reader/out.ll @@ -1,25 +1,25 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/reader' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/reader" %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } -%main.nopCloserWriterTo = type { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } -%main.nopCloser = type { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } +%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" = type { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } +%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser" = type { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.errorString = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } -%main.stringReader = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", i64, i64 } +%"github.com/goplus/llgo/compiler/cl/_testgo/reader.errorString" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } +%"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", i64, i64 } %"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } -@main.EOF = global %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer, align 8 -@main.ErrShortWrite = global %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer, align 8 -@"main.init$guard" = global i1 false, align 1 -@_llgo_main.WriterTo = linkonce global ptr null, align 8 -@0 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/reader.EOF" = global %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/reader.ErrShortWrite" = global %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/reader.init$guard" = global i1 false, align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.WriterTo" = linkonce global ptr null, align 8 +@0 = private unnamed_addr constant [49 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/reader", align 1 @1 = private unnamed_addr constant [8 x i8] c"WriterTo", align 1 -@_llgo_main.Writer = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.Writer" = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [6 x i8] c"Writer", align 1 @_llgo_byte = linkonce global ptr null, align 8 @"[]_llgo_byte" = linkonce global ptr null, align 8 @@ -32,33 +32,31 @@ source_filename = "main" @"_llgo_func$06yPPin-fnDnxFKkLLcJ1GEUhIobjPimde7T_Id_hmY" = linkonce global ptr null, align 8 @5 = private unnamed_addr constant [5 x i8] c"Write", align 1 @_llgo_int64 = linkonce global ptr null, align 8 -@"_llgo_func$MrYxYl10p_I07B55pBsGw9la9zbzU2vGDPLWrT714Uk" = linkonce global ptr null, align 8 +@"_llgo_func$-AbPruiRubbHNU-z4sJm4RCuzmjax87Xu2vXpjP2-tg" = linkonce global ptr null, align 8 @6 = private unnamed_addr constant [7 x i8] c"WriteTo", align 1 -@"_llgo_iface$eN81k1zqixGTyagHw_4nqH4mGfwwehTOCTXUlbT9kzk" = linkonce global ptr null, align 8 -@_llgo_main.nopCloserWriterTo = linkonce global ptr null, align 8 +@"_llgo_iface$fW3ehUYQ9HEsJUp-_gh8HbVb8TN9qyjzvxe-piX1P1o" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" = linkonce global ptr null, align 8 @7 = private unnamed_addr constant [17 x i8] c"nopCloserWriterTo", align 1 -@_llgo_main.Reader = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.Reader" = linkonce global ptr null, align 8 @8 = private unnamed_addr constant [6 x i8] c"Reader", align 1 @9 = private unnamed_addr constant [4 x i8] c"Read", align 1 -@"_llgo_struct$_3ow4zXXILqvC0WDqDRNq5DPhjE1DInJgN924VHWc2Y" = linkonce global ptr null, align 8 +@"_llgo_struct$zCmlqK6oRFYpWtMvv6Pe6GqaMY8pH8Js9Fj6dqbrNYo" = linkonce global ptr null, align 8 @10 = private unnamed_addr constant [5 x i8] c"Close", align 1 @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w" = linkonce global ptr null, align 8 @"_llgo_iface$L2Ik-AJcd0jsoBw5fQ07pQpfUM-kh78Wn2bOeak6M3I" = linkonce global ptr null, align 8 -@_llgo_main.nopCloser = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser" = linkonce global ptr null, align 8 @11 = private unnamed_addr constant [9 x i8] c"nopCloser", align 1 -@_llgo_main.StringWriter = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.StringWriter" = linkonce global ptr null, align 8 @12 = private unnamed_addr constant [12 x i8] c"StringWriter", align 1 @"_llgo_func$thH5FBpdXzJNnCpSfiLU5ItTntFU6LWp0RJhDm2XJjw" = linkonce global ptr null, align 8 @13 = private unnamed_addr constant [11 x i8] c"WriteString", align 1 @"_llgo_iface$Ly4zXiUMEac-hYAMw6b6miJ1JEhGfLyBWyBOhpsRZcU" = linkonce global ptr null, align 8 @14 = private unnamed_addr constant [3 x i8] c"EOF", align 1 @15 = private unnamed_addr constant [11 x i8] c"short write", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @16 = private unnamed_addr constant [11 x i8] c"hello world", align 1 -@_llgo_main.stringReader = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader" = linkonce global ptr null, align 8 @17 = private unnamed_addr constant [12 x i8] c"stringReader", align 1 -@"main.struct$Mdt84yjYYwxF9D2i4cRmpEPiWaO6tsjtrbGUjyESypk" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/reader.struct$Mdt84yjYYwxF9D2i4cRmpEPiWaO6tsjtrbGUjyESypk" = linkonce global ptr null, align 8 @18 = private unnamed_addr constant [1 x i8] c"s", align 1 @19 = private unnamed_addr constant [1 x i8] c"i", align 1 @20 = private unnamed_addr constant [8 x i8] c"prevRune", align 1 @@ -77,12 +75,12 @@ source_filename = "main" @"_llgo_func$Eoig9xhJM5GShHH5aNPxTZZXp1IZxprRl4zPuv2hkug" = linkonce global ptr null, align 8 @27 = private unnamed_addr constant [10 x i8] c"UnreadByte", align 1 @28 = private unnamed_addr constant [10 x i8] c"UnreadRune", align 1 -@"*_llgo_main.stringReader" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader" = linkonce global ptr null, align 8 @"_llgo_iface$OFO8Us9n8ajWCabGedeuoJ-Za2zAMk4Jh0FunAcUCFE" = linkonce global ptr null, align 8 -@_llgo_main.errorString = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.errorString" = linkonce global ptr null, align 8 @29 = private unnamed_addr constant [11 x i8] c"errorString", align 1 -@"main.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ" = linkonce global ptr null, align 8 -@"*_llgo_main.errorString" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/reader.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.errorString" = linkonce global ptr null, align 8 @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU" = linkonce global ptr null, align 8 @30 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 @31 = private unnamed_addr constant [37 x i8] c"stringsReader.ReadAt: negative offset", align 1 @@ -93,22 +91,22 @@ source_filename = "main" @36 = private unnamed_addr constant [62 x i8] c"strings.Reader.UnreadRune: previous operation was not ReadRune", align 1 @37 = private unnamed_addr constant [48 x i8] c"stringsReader.WriteTo: invalid WriteString count", align 1 -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.NopCloser(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.NopCloser"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) - %2 = load ptr, ptr @_llgo_main.WriterTo, align 8 + %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.WriterTo", align 8 %3 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %2, ptr %1) br i1 %3, label %_llgo_3, label %_llgo_4 _llgo_1: ; preds = %_llgo_5 - %4 = alloca %main.nopCloserWriterTo, align 8 + %4 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", align 8 call void @llvm.memset(ptr %4, i8 0, i64 16, i1 false) - %5 = getelementptr inbounds %main.nopCloserWriterTo, ptr %4, i32 0, i32 0 + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", ptr %4, i32 0, i32 0 store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, ptr %5, align 8 - %6 = load %main.nopCloserWriterTo, ptr %4, align 8 - %7 = load ptr, ptr @_llgo_main.nopCloserWriterTo, align 8 + %6 = load %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", ptr %4, align 8 + %7 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", align 8 %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %main.nopCloserWriterTo %6, ptr %8, align 8 + store %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" %6, ptr %8, align 8 %9 = load ptr, ptr @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w", align 8 %10 = load ptr, ptr @"_llgo_iface$L2Ik-AJcd0jsoBw5fQ07pQpfUM-kh78Wn2bOeak6M3I", align 8 %11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %10, ptr %7) @@ -117,14 +115,14 @@ _llgo_1: ; preds = %_llgo_5 ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %13 _llgo_2: ; preds = %_llgo_5 - %14 = alloca %main.nopCloser, align 8 + %14 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser", align 8 call void @llvm.memset(ptr %14, i8 0, i64 16, i1 false) - %15 = getelementptr inbounds %main.nopCloser, ptr %14, i32 0, i32 0 + %15 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser", ptr %14, i32 0, i32 0 store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, ptr %15, align 8 - %16 = load %main.nopCloser, ptr %14, align 8 - %17 = load ptr, ptr @_llgo_main.nopCloser, align 8 + %16 = load %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser", ptr %14, align 8 + %17 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser", align 8 %18 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %main.nopCloser %16, ptr %18, align 8 + store %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser" %16, ptr %18, align 8 %19 = load ptr, ptr @"_llgo_iface$L2Ik-AJcd0jsoBw5fQ07pQpfUM-kh78Wn2bOeak6M3I", align 8 %20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %19, ptr %17) %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %20, 0 @@ -133,7 +131,7 @@ _llgo_2: ; preds = %_llgo_5 _llgo_3: ; preds = %_llgo_0 %23 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, 1 - %24 = load ptr, ptr @"_llgo_iface$eN81k1zqixGTyagHw_4nqH4mGfwwehTOCTXUlbT9kzk", align 8 + %24 = load ptr, ptr @"_llgo_iface$fW3ehUYQ9HEsJUp-_gh8HbVb8TN9qyjzvxe-piX1P1o", align 8 %25 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %24, ptr %1) %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %25, 0 %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %26, ptr %23, 1 @@ -151,7 +149,7 @@ _llgo_5: ; preds = %_llgo_4, %_llgo_3 br i1 %32, label %_llgo_1, label %_llgo_2 } -define { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @main.ReadAll(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { +define { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.ReadAll"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 512) %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %1, i64 1, i64 512, i64 0, i64 0, i64 512) @@ -192,7 +190,7 @@ _llgo_1: ; preds = %_llgo_6, %_llgo_3, br i1 %33, label %_llgo_2, label %_llgo_3 _llgo_2: ; preds = %_llgo_1 - %34 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @main.EOF, align 8 + %34 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.EOF", align 8 %35 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %19) %36 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %19, 1 %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %35, 0 @@ -236,10 +234,10 @@ _llgo_6: ; preds = %_llgo_3 br label %_llgo_1 } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @main.WriteString(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.WriteString"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) { _llgo_0: %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) - %3 = load ptr, ptr @_llgo_main.StringWriter, align 8 + %3 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.StringWriter", align 8 %4 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %3, ptr %2) br i1 %4, label %_llgo_3, label %_llgo_4 @@ -296,65 +294,61 @@ _llgo_5: ; preds = %_llgo_4, %_llgo_3 br i1 %41, label %_llgo_1, label %_llgo_2 } -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"main.(*errorString).Error"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*errorString).Error"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.errorString, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.errorString", ptr %0, i32 0, i32 0 %2 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %1, align 8 ret %"github.com/goplus/llgo/runtime/internal/runtime.String" %2 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reader.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.init$guard", align 1 call void @"unicode/utf8.init"() - call void @"main.init$after"() - %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.newError(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 3 }) - store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1, ptr @main.EOF, align 8 - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.newError(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 11 }) - store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2, ptr @main.ErrShortWrite, align 8 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/reader.init$after"() + %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.newError"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 3 }) + store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.EOF", align 8 + %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.newError"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 11 }) + store %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.ErrShortWrite", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reader.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %3 = getelementptr inbounds %main.stringReader, ptr %2, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @16, i64 11 }, ptr %3, align 8 - %4 = load ptr, ptr @_llgo_main.stringReader, align 8 - %5 = load ptr, ptr @"*_llgo_main.stringReader", align 8 - %6 = load ptr, ptr @"_llgo_iface$OFO8Us9n8ajWCabGedeuoJ-Za2zAMk4Jh0FunAcUCFE", align 8 - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %6, ptr %5) - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %7, 0 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %8, ptr %2, 1 - %10 = call { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @main.ReadAll(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %9) - %11 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %10, 0 - %12 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %10, 1 - %13 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %11) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %13) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @16, i64 11 }, ptr %1, align 8 + %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", align 8 + %3 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", align 8 + %4 = load ptr, ptr @"_llgo_iface$OFO8Us9n8ajWCabGedeuoJ-Za2zAMk4Jh0FunAcUCFE", align 8 + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %4, ptr %3) + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %5, 0 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %6, ptr %0, 1 + %8 = call { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.ReadAll"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %7) + %9 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %8, 0 + %10 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %8, 1 + %11 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %11) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %12) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %10) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.newError(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.newError"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %2 = getelementptr inbounds %main.errorString, ptr %1, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.errorString", ptr %1, i32 0, i32 0 store %"github.com/goplus/llgo/runtime/internal/runtime.String" %0, ptr %2, align 8 - %3 = load ptr, ptr @_llgo_main.errorString, align 8 - %4 = load ptr, ptr @"*_llgo_main.errorString", align 8 + %3 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.errorString", align 8 + %4 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.errorString", align 8 %5 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8 %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %5, ptr %4) %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %6, 0 @@ -362,17 +356,17 @@ _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %8 } -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.nopCloser.Close(%main.nopCloser %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser.Close"(%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser" %0) { _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @main.nopCloser.Read(%main.nopCloser %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser.Read"(%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser" %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { _llgo_0: - %2 = alloca %main.nopCloser, align 8 + %2 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser", align 8 call void @llvm.memset(ptr %2, i8 0, i64 16, i1 false) - store %main.nopCloser %0, ptr %2, align 8 - %3 = getelementptr inbounds %main.nopCloser, ptr %2, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser" %0, ptr %2, align 8 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser", ptr %2, i32 0, i32 0 %4 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %3, align 8 %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %4) %6 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %4, 0 @@ -390,16 +384,16 @@ _llgo_0: ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %17 } -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.(*nopCloser).Close"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloser).Close"(ptr %0) { _llgo_0: - %1 = load %main.nopCloser, ptr %0, align 8 - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.nopCloser.Close(%main.nopCloser %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser", ptr %0, align 8 + %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser.Close"(%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser" %1) ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2 } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"main.(*nopCloser).Read"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloser).Read"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { _llgo_0: - %2 = getelementptr inbounds %main.nopCloser, ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser", ptr %0, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %2, align 8 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %3) %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %3, 0 @@ -417,17 +411,17 @@ _llgo_0: ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %16 } -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.nopCloserWriterTo.Close(%main.nopCloserWriterTo %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo.Close"(%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" %0) { _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @main.nopCloserWriterTo.Read(%main.nopCloserWriterTo %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo.Read"(%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { _llgo_0: - %2 = alloca %main.nopCloserWriterTo, align 8 + %2 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", align 8 call void @llvm.memset(ptr %2, i8 0, i64 16, i1 false) - store %main.nopCloserWriterTo %0, ptr %2, align 8 - %3 = getelementptr inbounds %main.nopCloserWriterTo, ptr %2, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" %0, ptr %2, align 8 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", ptr %2, i32 0, i32 0 %4 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %3, align 8 %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %4) %6 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %4, 0 @@ -445,21 +439,21 @@ _llgo_0: ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %17 } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @main.nopCloserWriterTo.WriteTo(%main.nopCloserWriterTo %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo.WriteTo"(%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { _llgo_0: - %2 = alloca %main.nopCloserWriterTo, align 8 + %2 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", align 8 call void @llvm.memset(ptr %2, i8 0, i64 16, i1 false) - store %main.nopCloserWriterTo %0, ptr %2, align 8 - %3 = getelementptr inbounds %main.nopCloserWriterTo, ptr %2, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" %0, ptr %2, align 8 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", ptr %2, i32 0, i32 0 %4 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %3, align 8 %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %4) - %6 = load ptr, ptr @_llgo_main.WriterTo, align 8 + %6 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.WriterTo", align 8 %7 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %6, ptr %5) br i1 %7, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 %8 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %4, 1 - %9 = load ptr, ptr @"_llgo_iface$eN81k1zqixGTyagHw_4nqH4mGfwwehTOCTXUlbT9kzk", align 8 + %9 = load ptr, ptr @"_llgo_iface$fW3ehUYQ9HEsJUp-_gh8HbVb8TN9qyjzvxe-piX1P1o", align 8 %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %9, ptr %5) %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %10, 0 %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %11, ptr %8, 1 @@ -488,16 +482,16 @@ _llgo_2: ; preds = %_llgo_0 unreachable } -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.(*nopCloserWriterTo).Close"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).Close"(ptr %0) { _llgo_0: - %1 = load %main.nopCloserWriterTo, ptr %0, align 8 - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.nopCloserWriterTo.Close(%main.nopCloserWriterTo %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", ptr %0, align 8 + %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo.Close"(%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" %1) ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2 } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"main.(*nopCloserWriterTo).Read"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).Read"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { _llgo_0: - %2 = getelementptr inbounds %main.nopCloserWriterTo, ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", ptr %0, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %2, align 8 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %3) %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %3, 0 @@ -515,10 +509,10 @@ _llgo_0: ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %16 } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"main.(*nopCloserWriterTo).WriteTo"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).WriteTo"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { _llgo_0: - %2 = load %main.nopCloserWriterTo, ptr %0, align 8 - %3 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @main.nopCloserWriterTo.WriteTo(%main.nopCloserWriterTo %2, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) + %2 = load %"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", ptr %0, align 8 + %3 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo.WriteTo"(%"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo" %2, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) %4 = extractvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %3, 0 %5 = extractvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %3, 1 %6 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } undef, i64 %4, 0 @@ -526,11 +520,11 @@ _llgo_0: ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %7 } -define i64 @"main.(*stringReader).Len"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Len"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %2 = load i64, ptr %1, align 4 - %3 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %4 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %3, align 8 %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %4, 1 %6 = icmp sge i64 %2, %5 @@ -540,76 +534,76 @@ _llgo_1: ; preds = %_llgo_0 ret i64 0 _llgo_2: ; preds = %_llgo_0 - %7 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %8 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %7, align 8 %9 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %8, 1 - %10 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %11 = load i64, ptr %10, align 4 %12 = sub i64 %9, %11 ret i64 %12 } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"main.(*stringReader).Read"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Read"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { _llgo_0: - %2 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %3 = load i64, ptr %2, align 4 - %4 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %5 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %4, align 8 %6 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %5, 1 %7 = icmp sge i64 %3, %6 br i1 %7, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %8 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @main.EOF, align 8 + %8 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.EOF", align 8 %9 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } { i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef }, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %8, 1 ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %9 _llgo_2: ; preds = %_llgo_0 - %10 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 store i64 -1, ptr %10, align 4 - %11 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %11 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %12 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %11, align 8 - %13 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %13 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %14 = load i64, ptr %13, align 4 %15 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %12, 1 %16 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %12, i64 %14, i64 %15) %17 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %16, 0 %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %16, 1 %19 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.SliceCopy"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, ptr %17, i64 %18, i64 1) - %20 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %20 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %21 = load i64, ptr %20, align 4 %22 = add i64 %21, %19 - %23 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %23 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 store i64 %22, ptr %23, align 4 %24 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } undef, i64 %19, 0 %25 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %24, %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer, 1 ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %25 } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"main.(*stringReader).ReadAt"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, i64 %2) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).ReadAt"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, i64 %2) { _llgo_0: %3 = icmp slt i64 %2, 0 br i1 %3, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %4 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.newError(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @31, i64 37 }) + %4 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.newError"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @31, i64 37 }) %5 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } { i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef }, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %4, 1 ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %5 _llgo_2: ; preds = %_llgo_0 - %6 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %7 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %6, align 8 %8 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %7, 1 %9 = icmp sge i64 %2, %8 br i1 %9, label %_llgo_3, label %_llgo_4 _llgo_3: ; preds = %_llgo_2 - %10 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @main.EOF, align 8 + %10 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.EOF", align 8 %11 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } { i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef }, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %10, 1 ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %11 _llgo_4: ; preds = %_llgo_2 - %12 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %13 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %12, align 8 %14 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %13, 1 %15 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %13, i64 %2, i64 %14) @@ -621,7 +615,7 @@ _llgo_4: ; preds = %_llgo_2 br i1 %20, label %_llgo_5, label %_llgo_6 _llgo_5: ; preds = %_llgo_4 - %21 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @main.EOF, align 8 + %21 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.EOF", align 8 br label %_llgo_6 _llgo_6: ; preds = %_llgo_5, %_llgo_4 @@ -631,27 +625,27 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %24 } -define { i8, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"main.(*stringReader).ReadByte"(ptr %0) { +define { i8, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).ReadByte"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 store i64 -1, ptr %1, align 4 - %2 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %3 = load i64, ptr %2, align 4 - %4 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %5 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %4, align 8 %6 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %5, 1 %7 = icmp sge i64 %3, %6 br i1 %7, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %8 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @main.EOF, align 8 + %8 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.EOF", align 8 %9 = insertvalue { i8, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } { i8 0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef }, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %8, 1 ret { i8, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %9 _llgo_2: ; preds = %_llgo_0 - %10 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %11 = load i64, ptr %10, align 4 - %12 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %13 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %12, align 8 %14 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %13, 0 %15 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %13, 1 @@ -661,41 +655,41 @@ _llgo_2: ; preds = %_llgo_0 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %18) %19 = getelementptr inbounds i8, ptr %14, i64 %11 %20 = load i8, ptr %19, align 1 - %21 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %21 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %22 = load i64, ptr %21, align 4 %23 = add i64 %22, 1 - %24 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %24 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 store i64 %23, ptr %24, align 4 %25 = insertvalue { i8, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } undef, i8 %20, 0 %26 = insertvalue { i8, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %25, %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer, 1 ret { i8, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %26 } -define { i32, i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"main.(*stringReader).ReadRune"(ptr %0) { +define { i32, i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).ReadRune"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %2 = load i64, ptr %1, align 4 - %3 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %4 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %3, align 8 %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %4, 1 %6 = icmp sge i64 %2, %5 br i1 %6, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %7 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 store i64 -1, ptr %7, align 4 - %8 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @main.EOF, align 8 + %8 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.EOF", align 8 %9 = insertvalue { i32, i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } { i32 0, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef }, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %8, 2 ret { i32, i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %9 _llgo_2: ; preds = %_llgo_0 - %10 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %11 = load i64, ptr %10, align 4 - %12 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 store i64 %11, ptr %12, align 4 - %13 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %13 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %14 = load i64, ptr %13, align 4 - %15 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %15 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %16 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %15, align 8 %17 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %16, 0 %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %16, 1 @@ -709,10 +703,10 @@ _llgo_2: ; preds = %_llgo_0 br i1 %24, label %_llgo_3, label %_llgo_4 _llgo_3: ; preds = %_llgo_2 - %25 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %25 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %26 = load i64, ptr %25, align 4 %27 = add i64 %26, 1 - %28 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %28 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 store i64 %27, ptr %28, align 4 %29 = sext i8 %23 to i32 %30 = insertvalue { i32, i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } undef, i32 %29, 0 @@ -721,19 +715,19 @@ _llgo_3: ; preds = %_llgo_2 ret { i32, i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %32 _llgo_4: ; preds = %_llgo_2 - %33 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %33 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %34 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %33, align 8 - %35 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %35 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %36 = load i64, ptr %35, align 4 %37 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %34, 1 %38 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %34, i64 %36, i64 %37) %39 = call { i32, i64 } @"unicode/utf8.DecodeRuneInString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %38) %40 = extractvalue { i32, i64 } %39, 0 %41 = extractvalue { i32, i64 } %39, 1 - %42 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %42 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %43 = load i64, ptr %42, align 4 %44 = add i64 %43, %41 - %45 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %45 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 store i64 %44, ptr %45, align 4 %46 = insertvalue { i32, i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } undef, i32 %40, 0 %47 = insertvalue { i32, i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %46, i64 %41, 1 @@ -741,9 +735,9 @@ _llgo_4: ; preds = %_llgo_2 ret { i32, i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %48 } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"main.(*stringReader).Seek"(ptr %0, i64 %1, i64 %2) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Seek"(ptr %0, i64 %1, i64 %2) { _llgo_0: - %3 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 store i64 -1, ptr %3, align 4 %4 = icmp eq i64 %2, 0 br i1 %4, label %_llgo_2, label %_llgo_4 @@ -757,7 +751,7 @@ _llgo_2: ; preds = %_llgo_0 br label %_llgo_1 _llgo_3: ; preds = %_llgo_4 - %7 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %8 = load i64, ptr %7, align 4 %9 = add i64 %8, %1 br label %_llgo_1 @@ -767,7 +761,7 @@ _llgo_4: ; preds = %_llgo_0 br i1 %10, label %_llgo_3, label %_llgo_6 _llgo_5: ; preds = %_llgo_6 - %11 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %11 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %12 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %11, align 8 %13 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %12, 1 %14 = add i64 %13, %1 @@ -778,91 +772,91 @@ _llgo_6: ; preds = %_llgo_4 br i1 %15, label %_llgo_5, label %_llgo_7 _llgo_7: ; preds = %_llgo_6 - %16 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.newError(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @32, i64 34 }) + %16 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.newError"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @32, i64 34 }) %17 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } { i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef }, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %16, 1 ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %17 _llgo_8: ; preds = %_llgo_1 - %18 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.newError(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @33, i64 37 }) + %18 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.newError"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @33, i64 37 }) %19 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } { i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef }, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %18, 1 ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %19 _llgo_9: ; preds = %_llgo_1 - %20 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %20 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 store i64 %5, ptr %20, align 4 %21 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } undef, i64 %5, 0 %22 = insertvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %21, %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer, 1 ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %22 } -define i64 @"main.(*stringReader).Size"(ptr %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Size"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %2 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %1, align 8 %3 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %2, 1 ret i64 %3 } -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.(*stringReader).UnreadByte"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).UnreadByte"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %2 = load i64, ptr %1, align 4 %3 = icmp sle i64 %2, 0 br i1 %3, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %4 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.newError(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @34, i64 48 }) + %4 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.newError"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @34, i64 48 }) ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %4 _llgo_2: ; preds = %_llgo_0 - %5 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 store i64 -1, ptr %5, align 4 - %6 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %7 = load i64, ptr %6, align 4 %8 = sub i64 %7, 1 - %9 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 store i64 %8, ptr %9, align 4 ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer } -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.(*stringReader).UnreadRune"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).UnreadRune"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %2 = load i64, ptr %1, align 4 %3 = icmp sle i64 %2, 0 br i1 %3, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %4 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.newError(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @35, i64 49 }) + %4 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.newError"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @35, i64 49 }) ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %4 _llgo_2: ; preds = %_llgo_0 - %5 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 %6 = load i64, ptr %5, align 4 %7 = icmp slt i64 %6, 0 br i1 %7, label %_llgo_3, label %_llgo_4 _llgo_3: ; preds = %_llgo_2 - %8 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.newError(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @36, i64 62 }) + %8 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/reader.newError"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @36, i64 62 }) ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %8 _llgo_4: ; preds = %_llgo_2 - %9 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 %10 = load i64, ptr %9, align 4 - %11 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %11 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 store i64 %10, ptr %11, align 4 - %12 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 store i64 -1, ptr %12, align 4 ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer } -define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"main.(*stringReader).WriteTo"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { +define { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).WriteTo"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { _llgo_0: - %2 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 2 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 2 store i64 -1, ptr %2, align 4 - %3 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %4 = load i64, ptr %3, align 4 - %5 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %6 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %5, align 8 %7 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %6, 1 %8 = icmp sge i64 %4, %7 @@ -872,13 +866,13 @@ _llgo_1: ; preds = %_llgo_0 ret { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } zeroinitializer _llgo_2: ; preds = %_llgo_0 - %9 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 0 + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 0 %10 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %9, align 8 - %11 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %11 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %12 = load i64, ptr %11, align 4 %13 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %10, 1 %14 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %10, i64 %12, i64 %13) - %15 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @main.WriteString(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %1, %"github.com/goplus/llgo/runtime/internal/runtime.String" %14) + %15 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"github.com/goplus/llgo/compiler/cl/_testgo/reader.WriteString"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %1, %"github.com/goplus/llgo/runtime/internal/runtime.String" %14) %16 = extractvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %15, 0 %17 = extractvalue { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %15, 1 %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %14, 1 @@ -895,17 +889,17 @@ _llgo_3: ; preds = %_llgo_2 unreachable _llgo_4: ; preds = %_llgo_2 - %24 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %24 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 %25 = load i64, ptr %24, align 4 %26 = add i64 %25, %16 - %27 = getelementptr inbounds %main.stringReader, ptr %0, i32 0, i32 1 + %27 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", ptr %0, i32 0, i32 1 store i64 %26, ptr %27, align 4 %28 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %14, 1 %29 = icmp ne i64 %16, %28 br i1 %29, label %_llgo_7, label %_llgo_6 _llgo_5: ; preds = %_llgo_7 - %30 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @main.ErrShortWrite, align 8 + %30 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.ErrShortWrite", align 8 br label %_llgo_6 _llgo_6: ; preds = %_llgo_5, %_llgo_7, %_llgo_4 @@ -928,25 +922,25 @@ _llgo_7: ; preds = %_llgo_4 declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface") -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reader.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 8 }) - %1 = load ptr, ptr @_llgo_main.WriterTo, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 8 }) + %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.WriterTo", align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %0, ptr @_llgo_main.WriterTo, align 8 + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.WriterTo", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 6 }) - %4 = load ptr, ptr @_llgo_main.Writer, align 8 + %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 6 }) + %4 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.Writer", align 8 %5 = icmp eq ptr %4, null br i1 %5, label %_llgo_3, label %_llgo_4 _llgo_3: ; preds = %_llgo_2 - store ptr %3, ptr @_llgo_main.Writer, align 8 + store ptr %3, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.Writer", align 8 br label %_llgo_4 _llgo_4: ; preds = %_llgo_3, %_llgo_2 @@ -1086,7 +1080,7 @@ _llgo_21: ; preds = %_llgo_20 br label %_llgo_22 _llgo_22: ; preds = %_llgo_21, %_llgo_20 - %71 = load ptr, ptr @_llgo_main.Writer, align 8 + %71 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.Writer", align 8 %72 = load ptr, ptr @_llgo_int64, align 8 %73 = icmp eq ptr %72, null br i1 %73, label %_llgo_23, label %_llgo_24 @@ -1098,10 +1092,10 @@ _llgo_23: ; preds = %_llgo_22 _llgo_24: ; preds = %_llgo_23, %_llgo_22 %75 = load ptr, ptr @_llgo_int64, align 8 - %76 = load ptr, ptr @_llgo_main.Writer, align 8 + %76 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.Writer", align 8 %77 = load ptr, ptr @_llgo_int64, align 8 %78 = load ptr, ptr @_llgo_error, align 8 - %79 = load ptr, ptr @"_llgo_func$MrYxYl10p_I07B55pBsGw9la9zbzU2vGDPLWrT714Uk", align 8 + %79 = load ptr, ptr @"_llgo_func$-AbPruiRubbHNU-z4sJm4RCuzmjax87Xu2vXpjP2-tg", align 8 %80 = icmp eq ptr %79, null br i1 %80, label %_llgo_25, label %_llgo_26 @@ -1122,11 +1116,11 @@ _llgo_25: ; preds = %_llgo_24 %91 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %90, i64 2, 2 %92 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Func"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %85, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %91, i1 false) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %92) - store ptr %92, ptr @"_llgo_func$MrYxYl10p_I07B55pBsGw9la9zbzU2vGDPLWrT714Uk", align 8 + store ptr %92, ptr @"_llgo_func$-AbPruiRubbHNU-z4sJm4RCuzmjax87Xu2vXpjP2-tg", align 8 br label %_llgo_26 _llgo_26: ; preds = %_llgo_25, %_llgo_24 - %93 = load ptr, ptr @"_llgo_func$MrYxYl10p_I07B55pBsGw9la9zbzU2vGDPLWrT714Uk", align 8 + %93 = load ptr, ptr @"_llgo_func$-AbPruiRubbHNU-z4sJm4RCuzmjax87Xu2vXpjP2-tg", align 8 br i1 %2, label %_llgo_27, label %_llgo_28 _llgo_27: ; preds = %_llgo_26 @@ -1141,8 +1135,8 @@ _llgo_27: ; preds = %_llgo_26 br label %_llgo_28 _llgo_28: ; preds = %_llgo_27, %_llgo_26 - %100 = load ptr, ptr @"_llgo_func$MrYxYl10p_I07B55pBsGw9la9zbzU2vGDPLWrT714Uk", align 8 - %101 = load ptr, ptr @"_llgo_iface$eN81k1zqixGTyagHw_4nqH4mGfwwehTOCTXUlbT9kzk", align 8 + %100 = load ptr, ptr @"_llgo_func$-AbPruiRubbHNU-z4sJm4RCuzmjax87Xu2vXpjP2-tg", align 8 + %101 = load ptr, ptr @"_llgo_iface$fW3ehUYQ9HEsJUp-_gh8HbVb8TN9qyjzvxe-piX1P1o", align 8 %102 = icmp eq ptr %101, null br i1 %102, label %_llgo_29, label %_llgo_30 @@ -1154,20 +1148,20 @@ _llgo_29: ; preds = %_llgo_28 %106 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %104, 0 %107 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %106, i64 1, 1 %108 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %107, i64 1, 2 - %109 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %108) - store ptr %109, ptr @"_llgo_iface$eN81k1zqixGTyagHw_4nqH4mGfwwehTOCTXUlbT9kzk", align 8 + %109 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %108) + store ptr %109, ptr @"_llgo_iface$fW3ehUYQ9HEsJUp-_gh8HbVb8TN9qyjzvxe-piX1P1o", align 8 br label %_llgo_30 _llgo_30: ; preds = %_llgo_29, %_llgo_28 - %110 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 17 }, i64 25, i64 16, i64 3, i64 3) - store ptr %110, ptr @_llgo_main.nopCloserWriterTo, align 8 - %111 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 6 }) - %112 = load ptr, ptr @_llgo_main.Reader, align 8 + %110 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 17 }, i64 25, i64 16, i64 3, i64 3) + store ptr %110, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo", align 8 + %111 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 6 }) + %112 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.Reader", align 8 %113 = icmp eq ptr %112, null br i1 %113, label %_llgo_31, label %_llgo_32 _llgo_31: ; preds = %_llgo_30 - store ptr %111, ptr @_llgo_main.Reader, align 8 + store ptr %111, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.Reader", align 8 br label %_llgo_32 _llgo_32: ; preds = %_llgo_31, %_llgo_30 @@ -1187,8 +1181,8 @@ _llgo_33: ; preds = %_llgo_32 br label %_llgo_34 _llgo_34: ; preds = %_llgo_33, %_llgo_32 - %122 = load ptr, ptr @_llgo_main.Reader, align 8 - %123 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 6 }) + %122 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.Reader", align 8 + %123 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 6 }) %124 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 6 }, ptr %123, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 true) %125 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56) %126 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %125, i64 0 @@ -1196,9 +1190,9 @@ _llgo_34: ; preds = %_llgo_33, %_llgo_32 %127 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %125, 0 %128 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %127, i64 1, 1 %129 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %128, i64 1, 2 - %130 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %129) - store ptr %130, ptr @"_llgo_struct$_3ow4zXXILqvC0WDqDRNq5DPhjE1DInJgN924VHWc2Y", align 8 - %131 = load ptr, ptr @"_llgo_struct$_3ow4zXXILqvC0WDqDRNq5DPhjE1DInJgN924VHWc2Y", align 8 + %130 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %129) + store ptr %130, ptr @"_llgo_struct$zCmlqK6oRFYpWtMvv6Pe6GqaMY8pH8Js9Fj6dqbrNYo", align 8 + %131 = load ptr, ptr @"_llgo_struct$zCmlqK6oRFYpWtMvv6Pe6GqaMY8pH8Js9Fj6dqbrNYo", align 8 %132 = load ptr, ptr @_llgo_error, align 8 %133 = load ptr, ptr @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w", align 8 %134 = icmp eq ptr %133, null @@ -1223,25 +1217,25 @@ _llgo_35: ; preds = %_llgo_34 _llgo_36: ; preds = %_llgo_35, %_llgo_34 %145 = load ptr, ptr @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w", align 8 %146 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 5 }, ptr undef, ptr undef, ptr undef }, ptr %145, 1 - %147 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %146, ptr @"main.(*nopCloserWriterTo).Close", 2 - %148 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %147, ptr @"main.(*nopCloserWriterTo).Close", 3 + %147 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %146, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).Close", 2 + %148 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %147, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).Close", 3 %149 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 5 }, ptr undef, ptr undef, ptr undef }, ptr %145, 1 - %150 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %149, ptr @"main.(*nopCloserWriterTo).Close", 2 - %151 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %150, ptr @main.nopCloserWriterTo.Close, 3 + %150 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %149, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).Close", 2 + %151 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %150, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo.Close", 3 %152 = load ptr, ptr @"_llgo_func$06yPPin-fnDnxFKkLLcJ1GEUhIobjPimde7T_Id_hmY", align 8 %153 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %152, 1 - %154 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %153, ptr @"main.(*nopCloserWriterTo).Read", 2 - %155 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %154, ptr @"main.(*nopCloserWriterTo).Read", 3 + %154 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %153, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).Read", 2 + %155 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %154, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).Read", 3 %156 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %152, 1 - %157 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %156, ptr @"main.(*nopCloserWriterTo).Read", 2 - %158 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %157, ptr @main.nopCloserWriterTo.Read, 3 - %159 = load ptr, ptr @"_llgo_func$MrYxYl10p_I07B55pBsGw9la9zbzU2vGDPLWrT714Uk", align 8 + %157 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %156, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).Read", 2 + %158 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %157, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo.Read", 3 + %159 = load ptr, ptr @"_llgo_func$-AbPruiRubbHNU-z4sJm4RCuzmjax87Xu2vXpjP2-tg", align 8 %160 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 7 }, ptr undef, ptr undef, ptr undef }, ptr %159, 1 - %161 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %160, ptr @"main.(*nopCloserWriterTo).WriteTo", 2 - %162 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %161, ptr @"main.(*nopCloserWriterTo).WriteTo", 3 + %161 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %160, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).WriteTo", 2 + %162 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %161, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).WriteTo", 3 %163 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 7 }, ptr undef, ptr undef, ptr undef }, ptr %159, 1 - %164 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %163, ptr @"main.(*nopCloserWriterTo).WriteTo", 2 - %165 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %164, ptr @main.nopCloserWriterTo.WriteTo, 3 + %164 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %163, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloserWriterTo).WriteTo", 2 + %165 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %164, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloserWriterTo.WriteTo", 3 %166 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 120) %167 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %166, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %151, ptr %167, align 8 @@ -1280,28 +1274,28 @@ _llgo_37: ; preds = %_llgo_36 %189 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %186, 0 %190 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %189, i64 2, 1 %191 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %190, i64 2, 2 - %192 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %191) + %192 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %191) store ptr %192, ptr @"_llgo_iface$L2Ik-AJcd0jsoBw5fQ07pQpfUM-kh78Wn2bOeak6M3I", align 8 br label %_llgo_38 _llgo_38: ; preds = %_llgo_37, %_llgo_36 - %193 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 9 }, i64 25, i64 16, i64 2, i64 2) - store ptr %193, ptr @_llgo_main.nopCloser, align 8 - %194 = load ptr, ptr @"_llgo_struct$_3ow4zXXILqvC0WDqDRNq5DPhjE1DInJgN924VHWc2Y", align 8 + %193 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 9 }, i64 25, i64 16, i64 2, i64 2) + store ptr %193, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser", align 8 + %194 = load ptr, ptr @"_llgo_struct$zCmlqK6oRFYpWtMvv6Pe6GqaMY8pH8Js9Fj6dqbrNYo", align 8 %195 = load ptr, ptr @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w", align 8 %196 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 5 }, ptr undef, ptr undef, ptr undef }, ptr %195, 1 - %197 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %196, ptr @"main.(*nopCloser).Close", 2 - %198 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %197, ptr @"main.(*nopCloser).Close", 3 + %197 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %196, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloser).Close", 2 + %198 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %197, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloser).Close", 3 %199 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 5 }, ptr undef, ptr undef, ptr undef }, ptr %195, 1 - %200 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %199, ptr @"main.(*nopCloser).Close", 2 - %201 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %200, ptr @main.nopCloser.Close, 3 + %200 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %199, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloser).Close", 2 + %201 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %200, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser.Close", 3 %202 = load ptr, ptr @"_llgo_func$06yPPin-fnDnxFKkLLcJ1GEUhIobjPimde7T_Id_hmY", align 8 %203 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %202, 1 - %204 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %203, ptr @"main.(*nopCloser).Read", 2 - %205 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %204, ptr @"main.(*nopCloser).Read", 3 + %204 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %203, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloser).Read", 2 + %205 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %204, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloser).Read", 3 %206 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %202, 1 - %207 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %206, ptr @"main.(*nopCloser).Read", 2 - %208 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %207, ptr @main.nopCloser.Read, 3 + %207 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %206, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*nopCloser).Read", 2 + %208 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %207, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.nopCloser.Read", 3 %209 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 80) %210 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %209, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %201, ptr %210, align 8 @@ -1319,13 +1313,13 @@ _llgo_38: ; preds = %_llgo_37, %_llgo_36 %219 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %218, i64 2, 1 %220 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %219, i64 2, 2 call void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr %193, ptr %194, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %214, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %220) - %221 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 12 }) - %222 = load ptr, ptr @_llgo_main.StringWriter, align 8 + %221 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 12 }) + %222 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.StringWriter", align 8 %223 = icmp eq ptr %222, null br i1 %223, label %_llgo_39, label %_llgo_40 _llgo_39: ; preds = %_llgo_38 - store ptr %221, ptr @_llgo_main.StringWriter, align 8 + store ptr %221, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.StringWriter", align 8 br label %_llgo_40 _llgo_40: ; preds = %_llgo_39, %_llgo_38 @@ -1385,13 +1379,13 @@ _llgo_45: ; preds = %_llgo_44 %254 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %252, 0 %255 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %254, i64 1, 1 %256 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %255, i64 1, 2 - %257 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %256) + %257 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %256) store ptr %257, ptr @"_llgo_iface$Ly4zXiUMEac-hYAMw6b6miJ1JEhGfLyBWyBOhpsRZcU", align 8 br label %_llgo_46 _llgo_46: ; preds = %_llgo_45, %_llgo_44 - %258 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 12 }, i64 25, i64 32, i64 0, i64 10) - store ptr %258, ptr @_llgo_main.stringReader, align 8 + %258 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 12 }, i64 25, i64 32, i64 0, i64 10) + store ptr %258, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", align 8 %259 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 24) %260 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @18, i64 1 }, ptr %259, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %261 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 38) @@ -1408,9 +1402,9 @@ _llgo_46: ; preds = %_llgo_45, %_llgo_44 %269 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %265, 0 %270 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %269, i64 3, 1 %271 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %270, i64 3, 2 - %272 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 32, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %271) - store ptr %272, ptr @"main.struct$Mdt84yjYYwxF9D2i4cRmpEPiWaO6tsjtrbGUjyESypk", align 8 - %273 = load ptr, ptr @"main.struct$Mdt84yjYYwxF9D2i4cRmpEPiWaO6tsjtrbGUjyESypk", align 8 + %272 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, i64 32, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %271) + store ptr %272, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.struct$Mdt84yjYYwxF9D2i4cRmpEPiWaO6tsjtrbGUjyESypk", align 8 + %273 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.struct$Mdt84yjYYwxF9D2i4cRmpEPiWaO6tsjtrbGUjyESypk", align 8 %274 = load ptr, ptr @_llgo_int, align 8 %275 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %276 = icmp eq ptr %275, null @@ -1435,13 +1429,13 @@ _llgo_47: ; preds = %_llgo_46 _llgo_48: ; preds = %_llgo_47, %_llgo_46 %287 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %288 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @21, i64 3 }, ptr undef, ptr undef, ptr undef }, ptr %287, 1 - %289 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %288, ptr @"main.(*stringReader).Len", 2 - %290 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %289, ptr @"main.(*stringReader).Len", 3 + %289 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %288, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Len", 2 + %290 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %289, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Len", 3 %291 = load ptr, ptr @"[]_llgo_byte", align 8 %292 = load ptr, ptr @"_llgo_func$06yPPin-fnDnxFKkLLcJ1GEUhIobjPimde7T_Id_hmY", align 8 %293 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %292, 1 - %294 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %293, ptr @"main.(*stringReader).Read", 2 - %295 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %294, ptr @"main.(*stringReader).Read", 3 + %294 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %293, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Read", 2 + %295 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %294, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Read", 3 %296 = load ptr, ptr @"[]_llgo_byte", align 8 %297 = load ptr, ptr @"[]_llgo_byte", align 8 %298 = load ptr, ptr @_llgo_int64, align 8 @@ -1476,8 +1470,8 @@ _llgo_49: ; preds = %_llgo_48 _llgo_50: ; preds = %_llgo_49, %_llgo_48 %316 = load ptr, ptr @"_llgo_func$TY5Etv7VBKM_-2um1BDEeQEE2lP06Pt6G54EuKiNC3c", align 8 %317 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @22, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %316, 1 - %318 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %317, ptr @"main.(*stringReader).ReadAt", 2 - %319 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %318, ptr @"main.(*stringReader).ReadAt", 3 + %318 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %317, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).ReadAt", 2 + %319 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %318, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).ReadAt", 3 %320 = load ptr, ptr @_llgo_byte, align 8 %321 = load ptr, ptr @_llgo_error, align 8 %322 = load ptr, ptr @"_llgo_func$6bvVpCcGPUc3z_EmsQTHB0AVT1hP5-NNLVRgm43teCM", align 8 @@ -1505,8 +1499,8 @@ _llgo_51: ; preds = %_llgo_50 _llgo_52: ; preds = %_llgo_51, %_llgo_50 %335 = load ptr, ptr @"_llgo_func$6bvVpCcGPUc3z_EmsQTHB0AVT1hP5-NNLVRgm43teCM", align 8 %336 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @23, i64 8 }, ptr undef, ptr undef, ptr undef }, ptr %335, 1 - %337 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %336, ptr @"main.(*stringReader).ReadByte", 2 - %338 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %337, ptr @"main.(*stringReader).ReadByte", 3 + %337 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %336, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).ReadByte", 2 + %338 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %337, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).ReadByte", 3 %339 = load ptr, ptr @_llgo_rune, align 8 %340 = icmp eq ptr %339, null br i1 %340, label %_llgo_53, label %_llgo_54 @@ -1548,8 +1542,8 @@ _llgo_55: ; preds = %_llgo_54 _llgo_56: ; preds = %_llgo_55, %_llgo_54 %360 = load ptr, ptr @"_llgo_func$CB0CO6hV_feSzhi4pz1P4omza2fKNK930wvOR1T33fU", align 8 %361 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @24, i64 8 }, ptr undef, ptr undef, ptr undef }, ptr %360, 1 - %362 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %361, ptr @"main.(*stringReader).ReadRune", 2 - %363 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %362, ptr @"main.(*stringReader).ReadRune", 3 + %362 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %361, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).ReadRune", 2 + %363 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %362, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).ReadRune", 3 %364 = load ptr, ptr @_llgo_int64, align 8 %365 = load ptr, ptr @_llgo_int, align 8 %366 = load ptr, ptr @_llgo_int64, align 8 @@ -1583,8 +1577,8 @@ _llgo_57: ; preds = %_llgo_56 _llgo_58: ; preds = %_llgo_57, %_llgo_56 %383 = load ptr, ptr @"_llgo_func$HE7H49xPa1uXmrkMDpqB3RCRGf3qzhLGrxKCEXOYjms", align 8 %384 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @25, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %383, 1 - %385 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %384, ptr @"main.(*stringReader).Seek", 2 - %386 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %385, ptr @"main.(*stringReader).Seek", 3 + %385 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %384, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Seek", 2 + %386 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %385, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Seek", 3 %387 = load ptr, ptr @_llgo_int64, align 8 %388 = load ptr, ptr @"_llgo_func$Eoig9xhJM5GShHH5aNPxTZZXp1IZxprRl4zPuv2hkug", align 8 %389 = icmp eq ptr %388, null @@ -1609,20 +1603,20 @@ _llgo_59: ; preds = %_llgo_58 _llgo_60: ; preds = %_llgo_59, %_llgo_58 %400 = load ptr, ptr @"_llgo_func$Eoig9xhJM5GShHH5aNPxTZZXp1IZxprRl4zPuv2hkug", align 8 %401 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @26, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %400, 1 - %402 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %401, ptr @"main.(*stringReader).Size", 2 - %403 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %402, ptr @"main.(*stringReader).Size", 3 + %402 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %401, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Size", 2 + %403 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %402, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).Size", 3 %404 = load ptr, ptr @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w", align 8 %405 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @27, i64 10 }, ptr undef, ptr undef, ptr undef }, ptr %404, 1 - %406 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %405, ptr @"main.(*stringReader).UnreadByte", 2 - %407 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %406, ptr @"main.(*stringReader).UnreadByte", 3 + %406 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %405, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).UnreadByte", 2 + %407 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %406, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).UnreadByte", 3 %408 = load ptr, ptr @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w", align 8 %409 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @28, i64 10 }, ptr undef, ptr undef, ptr undef }, ptr %408, 1 - %410 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %409, ptr @"main.(*stringReader).UnreadRune", 2 - %411 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %410, ptr @"main.(*stringReader).UnreadRune", 3 - %412 = load ptr, ptr @"_llgo_func$MrYxYl10p_I07B55pBsGw9la9zbzU2vGDPLWrT714Uk", align 8 + %410 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %409, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).UnreadRune", 2 + %411 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %410, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).UnreadRune", 3 + %412 = load ptr, ptr @"_llgo_func$-AbPruiRubbHNU-z4sJm4RCuzmjax87Xu2vXpjP2-tg", align 8 %413 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 7 }, ptr undef, ptr undef, ptr undef }, ptr %412, 1 - %414 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %413, ptr @"main.(*stringReader).WriteTo", 2 - %415 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %414, ptr @"main.(*stringReader).WriteTo", 3 + %414 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %413, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).WriteTo", 2 + %415 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %414, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*stringReader).WriteTo", 3 %416 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 400) %417 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %416, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %290, ptr %417, align 8 @@ -1648,10 +1642,10 @@ _llgo_60: ; preds = %_llgo_59, %_llgo_58 %428 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %427, i64 10, 1 %429 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %428, i64 10, 2 call void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr %258, ptr %273, { ptr, i64, i64 } zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %429) - %430 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 12 }, i64 25, i64 32, i64 0, i64 10) + %430 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @17, i64 12 }, i64 25, i64 32, i64 0, i64 10) %431 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %430) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %431) - store ptr %431, ptr @"*_llgo_main.stringReader", align 8 + store ptr %431, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.stringReader", align 8 %432 = load ptr, ptr @"_llgo_func$06yPPin-fnDnxFKkLLcJ1GEUhIobjPimde7T_Id_hmY", align 8 %433 = load ptr, ptr @"_llgo_iface$OFO8Us9n8ajWCabGedeuoJ-Za2zAMk4Jh0FunAcUCFE", align 8 %434 = icmp eq ptr %433, null @@ -1665,13 +1659,13 @@ _llgo_61: ; preds = %_llgo_60 %438 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %436, 0 %439 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %438, i64 1, 1 %440 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %439, i64 1, 2 - %441 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %440) + %441 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %440) store ptr %441, ptr @"_llgo_iface$OFO8Us9n8ajWCabGedeuoJ-Za2zAMk4Jh0FunAcUCFE", align 8 br label %_llgo_62 _llgo_62: ; preds = %_llgo_61, %_llgo_60 - %442 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @29, i64 11 }, i64 25, i64 16, i64 0, i64 1) - store ptr %442, ptr @_llgo_main.errorString, align 8 + %442 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @29, i64 11 }, i64 25, i64 16, i64 0, i64 1) + store ptr %442, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.errorString", align 8 %443 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 24) %444 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @18, i64 1 }, ptr %443, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %445 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56) @@ -1680,13 +1674,13 @@ _llgo_62: ; preds = %_llgo_61, %_llgo_60 %447 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %445, 0 %448 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %447, i64 1, 1 %449 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %448, i64 1, 2 - %450 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %449) - store ptr %450, ptr @"main.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 - %451 = load ptr, ptr @"main.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 + %450 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %449) + store ptr %450, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 + %451 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.struct$QTufDJA9wEDzuzgkA-ZSrLqW-B6lWN8O25mTSglAoLQ", align 8 %452 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 %453 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 5 }, ptr undef, ptr undef, ptr undef }, ptr %452, 1 - %454 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %453, ptr @"main.(*errorString).Error", 2 - %455 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %454, ptr @"main.(*errorString).Error", 3 + %454 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %453, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*errorString).Error", 2 + %455 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %454, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reader.(*errorString).Error", 3 %456 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %457 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %456, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %455, ptr %457, align 8 @@ -1694,10 +1688,10 @@ _llgo_62: ; preds = %_llgo_61, %_llgo_60 %459 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %458, i64 1, 1 %460 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %459, i64 1, 2 call void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr %442, ptr %451, { ptr, i64, i64 } zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %460) - %461 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @29, i64 11 }, i64 25, i64 16, i64 0, i64 1) + %461 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @29, i64 11 }, i64 25, i64 16, i64 0, i64 1) %462 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %461) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %462) - store ptr %462, ptr @"*_llgo_main.errorString", align 8 + store ptr %462, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reader.errorString", align 8 %463 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 %464 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8 %465 = icmp eq ptr %464, null @@ -1711,7 +1705,7 @@ _llgo_63: ; preds = %_llgo_62 %469 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %467, 0 %470 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %469, i64 1, 1 %471 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %470, i64 1, 2 - %472 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %471) + %472 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %471) store ptr %472, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8 br label %_llgo_64 @@ -1764,8 +1758,6 @@ declare %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/go declare void @"unicode/utf8.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr) declare %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice") diff --git a/compiler/cl/_testgo/reflect/out.ll b/compiler/cl/_testgo/reflect/out.ll index c25ba795..032c72a8 100644 --- a/compiler/cl/_testgo/reflect/out.ll +++ b/compiler/cl/_testgo/reflect/out.ll @@ -1,8 +1,8 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/reflect' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/reflect" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.T = type { i64 } +%"github.com/goplus/llgo/compiler/cl/_testgo/reflect.T" = type { i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %reflect.Value = type { ptr, ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } @@ -11,38 +11,36 @@ source_filename = "main" %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } %"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/reflect.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [11 x i8] c"call.method", align 1 @_llgo_int = linkonce global ptr null, align 8 @"_llgo_func$ekGNsrYBSzltfAjxbl6T8H6Yq8j16wzqS3nDj2xxGMU" = linkonce global ptr null, align 8 @_llgo_Pointer = linkonce global ptr null, align 8 -@"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk" = linkonce global ptr null, align 8 @1 = private unnamed_addr constant [2 x i8] c"$f", align 1 @2 = private unnamed_addr constant [5 x i8] c"$data", align 1 -@3 = private unnamed_addr constant [4 x i8] c"main", align 1 +@3 = private unnamed_addr constant [50 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/reflect", align 1 @4 = private unnamed_addr constant [7 x i8] c"closure", align 1 @5 = private unnamed_addr constant [5 x i8] c"error", align 1 @_llgo_string = linkonce global ptr null, align 8 @6 = private unnamed_addr constant [12 x i8] c"call.closure", align 1 @7 = private unnamed_addr constant [4 x i8] c"func", align 1 @8 = private unnamed_addr constant [9 x i8] c"call.func", align 1 -@_llgo_main.T = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reflect.T" = linkonce global ptr null, align 8 @9 = private unnamed_addr constant [1 x i8] c"T", align 1 -@"main.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U" = linkonce global ptr null, align 8 @10 = private unnamed_addr constant [1 x i8] c"n", align 1 @11 = private unnamed_addr constant [3 x i8] c"Add", align 1 -@"*_llgo_main.T" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reflect.T" = linkonce global ptr null, align 8 @"_llgo_iface$VdBKYV8-gcMjZtZfcf-u2oKoj9Lu3VXwuG8TGCW2S4A" = linkonce global ptr null, align 8 @12 = private unnamed_addr constant [7 x i8] c"imethod", align 1 @13 = private unnamed_addr constant [6 x i8] c"method", align 1 @_llgo_any = linkonce global ptr null, align 8 @"[]_llgo_any" = linkonce global ptr null, align 8 @"_llgo_func$KK0iU4Wpi3BdRqssvycXqtgNe2Dq1riBlM61Rds1QsU" = linkonce global ptr null, align 8 -@"main.struct$FjMjjQr3-2iTiWyZP1IIQFOz0hUCa0OS6pEm5uVV6Pk" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$FjMjjQr3-2iTiWyZP1IIQFOz0hUCa0OS6pEm5uVV6Pk" = linkonce global ptr null, align 8 @14 = private unnamed_addr constant [10 x i8] c"call.slice", align 1 @15 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @"map[_llgo_int]_llgo_string" = linkonce global ptr null, align 8 @16 = private unnamed_addr constant [7 x i8] c"topbits", align 1 @17 = private unnamed_addr constant [4 x i8] c"keys", align 1 @@ -55,32 +53,32 @@ source_filename = "main" @24 = private unnamed_addr constant [12 x i8] c"must invalid", align 1 @25 = private unnamed_addr constant [13 x i8] c"MapIter error", align 1 -define i64 @"main.(*T).Add"(ptr %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.(*T).Add"(ptr %0, i64 %1) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 11 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %2 = getelementptr inbounds %main.T, ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", ptr %0, i32 0, i32 0 %3 = load i64, ptr %2, align 4 %4 = add i64 %3, %1 - %5 = getelementptr inbounds %main.T, ptr %0, i32 0, i32 0 + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", ptr %0, i32 0, i32 0 store i64 %4, ptr %5, align 4 - %6 = getelementptr inbounds %main.T, ptr %0, i32 0, i32 0 + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", ptr %0, i32 0, i32 0 %7 = load i64, ptr %6, align 4 ret i64 %7 } -define void @main.callClosure() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callClosure"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) store i64 100, ptr %0, align 4 %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %2 = getelementptr inbounds { ptr }, ptr %1, i32 0, i32 0 store ptr %0, ptr %2, align 8 - %3 = insertvalue { ptr, ptr } { ptr @"main.callClosure$1", ptr undef }, ptr %1, 1 + %3 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callClosure$1", ptr undef }, ptr %1, 1 %4 = load ptr, ptr @_llgo_int, align 8 %5 = load ptr, ptr @"_llgo_func$ekGNsrYBSzltfAjxbl6T8H6Yq8j16wzqS3nDj2xxGMU", align 8 %6 = load ptr, ptr @_llgo_Pointer, align 8 - %7 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %7 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) store { ptr, ptr } %3, ptr %8, align 8 %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %7, 0 @@ -125,7 +123,7 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) %39 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %11) %40 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %39, 0 - %41 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %41 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 %42 = icmp eq ptr %40, %41 br i1 %42, label %_llgo_3, label %_llgo_4 @@ -161,7 +159,7 @@ _llgo_5: ; preds = %_llgo_4, %_llgo_3 br i1 %56, label %_llgo_2, label %_llgo_1 } -define i64 @"main.callClosure$1"(ptr %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callClosure$1"(ptr %0, i64 %1) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 12 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) @@ -173,11 +171,11 @@ _llgo_0: ret i64 %6 } -define void @main.callFunc() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callFunc"() { _llgo_0: - %0 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %0 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store { ptr, ptr } { ptr @"__llgo_stub.main.callFunc$1", ptr null }, ptr %1, align 8 + store { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/reflect.callFunc$1", ptr null }, ptr %1, align 8 %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, ptr %1, 1 %4 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %3) @@ -220,7 +218,7 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) %32 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %4) %33 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %32, 0 - %34 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %34 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 %35 = icmp eq ptr %33, %34 br i1 %35, label %_llgo_3, label %_llgo_4 @@ -256,7 +254,7 @@ _llgo_5: ; preds = %_llgo_4, %_llgo_3 br i1 %49, label %_llgo_2, label %_llgo_1 } -define i64 @"main.callFunc$1"(i64 %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callFunc$1"(i64 %0) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 9 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) @@ -264,13 +262,13 @@ _llgo_0: ret i64 %1 } -define void @main.callIMethod() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callIMethod"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %1 = getelementptr inbounds %main.T, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", ptr %0, i32 0, i32 0 store i64 1, ptr %1, align 4 - %2 = load ptr, ptr @_llgo_main.T, align 8 - %3 = load ptr, ptr @"*_llgo_main.T", align 8 + %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", align 8 + %3 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", align 8 %4 = load ptr, ptr @"_llgo_func$ekGNsrYBSzltfAjxbl6T8H6Yq8j16wzqS3nDj2xxGMU", align 8 %5 = load ptr, ptr @"_llgo_iface$VdBKYV8-gcMjZtZfcf-u2oKoj9Lu3VXwuG8TGCW2S4A", align 8 %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %5, ptr %3) @@ -321,7 +319,7 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) %42 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %14) %43 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %42, 0 - %44 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %44 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 %45 = icmp eq ptr %43, %44 br i1 %45, label %_llgo_3, label %_llgo_4 @@ -379,12 +377,12 @@ _llgo_5: ; preds = %_llgo_4, %_llgo_3 br i1 %77, label %_llgo_2, label %_llgo_1 } -define void @main.callMethod() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callMethod"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %1 = getelementptr inbounds %main.T, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", ptr %0, i32 0, i32 0 store i64 1, ptr %1, align 4 - %2 = load ptr, ptr @"*_llgo_main.T", align 8 + %2 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", align 8 %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, ptr %0, 1 %5 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %4) @@ -428,7 +426,7 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) %34 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %6) %35 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %34, 0 - %36 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %36 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 %37 = icmp eq ptr %35, %36 br i1 %37, label %_llgo_3, label %_llgo_4 @@ -486,14 +484,14 @@ _llgo_5: ; preds = %_llgo_4, %_llgo_3 br i1 %69, label %_llgo_2, label %_llgo_1 } -define void @main.callSlice() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callSlice"() { _llgo_0: %0 = load ptr, ptr @_llgo_any, align 8 %1 = load ptr, ptr @"[]_llgo_any", align 8 %2 = load ptr, ptr @"_llgo_func$KK0iU4Wpi3BdRqssvycXqtgNe2Dq1riBlM61Rds1QsU", align 8 - %3 = load ptr, ptr @"main.struct$FjMjjQr3-2iTiWyZP1IIQFOz0hUCa0OS6pEm5uVV6Pk", align 8 + %3 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$FjMjjQr3-2iTiWyZP1IIQFOz0hUCa0OS6pEm5uVV6Pk", align 8 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store { ptr, ptr } { ptr @__llgo_stub.main.demo, ptr null }, ptr %4, align 8 + store { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/reflect.demo", ptr null }, ptr %4, align 8 %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0 %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr %4, 1 %7 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %6) @@ -635,7 +633,7 @@ _llgo_0: ret void } -define { i64, i64 } @main.demo(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) { +define { i64, i64 } @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.demo"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) { _llgo_0: %10 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 1 br label %_llgo_1 @@ -690,38 +688,34 @@ _llgo_5: ; preds = %_llgo_2 unreachable } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.init$guard", align 1 call void @reflect.init() - call void @"main.init$after"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.callSlice() - call void @main.callFunc() - call void @main.callClosure() - call void @main.callMethod() - call void @main.callIMethod() - call void @main.mapDemo1() - call void @main.mapDemo2() - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callSlice"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callFunc"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callClosure"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callMethod"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callIMethod"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.mapDemo1"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.mapDemo2"() + ret void } -define void @main.mapDemo1() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.mapDemo1"() { _llgo_0: %0 = load ptr, ptr @"map[_llgo_int]_llgo_string", align 8 %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %0, i64 2) @@ -885,7 +879,7 @@ _llgo_14: ; preds = %_llgo_10 br i1 %98, label %_llgo_13, label %_llgo_12 } -define void @main.mapDemo2() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.mapDemo2"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 @@ -1077,7 +1071,7 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) declare %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = icmp eq ptr %0, null @@ -1151,8 +1145,8 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %37, 0 %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40, i64 2, 1 %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %41, i64 2, 2 - %43 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %42) - store ptr %43, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %43 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 50 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %42) + store ptr %43, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 %44 = load ptr, ptr @_llgo_string, align 8 %45 = icmp eq ptr %44, null br i1 %45, label %_llgo_7, label %_llgo_8 @@ -1163,13 +1157,13 @@ _llgo_7: ; preds = %_llgo_6 br label %_llgo_8 _llgo_8: ; preds = %_llgo_7, %_llgo_6 - %47 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 8, i64 0, i64 1) - %48 = load ptr, ptr @_llgo_main.T, align 8 + %47 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 8, i64 0, i64 1) + %48 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", align 8 %49 = icmp eq ptr %48, null br i1 %49, label %_llgo_9, label %_llgo_10 _llgo_9: ; preds = %_llgo_8 - store ptr %47, ptr @_llgo_main.T, align 8 + store ptr %47, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", align 8 br label %_llgo_10 _llgo_10: ; preds = %_llgo_9, %_llgo_8 @@ -1181,16 +1175,16 @@ _llgo_10: ; preds = %_llgo_9, %_llgo_8 %54 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %52, 0 %55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %54, i64 1, 1 %56 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %55, i64 1, 2 - %57 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %56) - store ptr %57, ptr @"main.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U", align 8 - %58 = load ptr, ptr @"main.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U", align 8 + %57 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 50 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %56) + store ptr %57, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U", align 8 + %58 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$eovYmOhZg4X0zMSsuscSshndnbbAGvB2E3cyG8E7Y4U", align 8 br i1 %49, label %_llgo_11, label %_llgo_12 _llgo_11: ; preds = %_llgo_10 %59 = load ptr, ptr @"_llgo_func$ekGNsrYBSzltfAjxbl6T8H6Yq8j16wzqS3nDj2xxGMU", align 8 %60 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 3 }, ptr undef, ptr undef, ptr undef }, ptr %59, 1 - %61 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %60, ptr @"main.(*T).Add", 2 - %62 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %61, ptr @"main.(*T).Add", 3 + %61 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %60, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.(*T).Add", 2 + %62 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %61, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.(*T).Add", 3 %63 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %64 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %63, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %62, ptr %64, align 8 @@ -1201,15 +1195,15 @@ _llgo_11: ; preds = %_llgo_10 br label %_llgo_12 _llgo_12: ; preds = %_llgo_11, %_llgo_10 - %68 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 8, i64 0, i64 1) - %69 = load ptr, ptr @"*_llgo_main.T", align 8 + %68 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 8, i64 0, i64 1) + %69 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", align 8 %70 = icmp eq ptr %69, null br i1 %70, label %_llgo_13, label %_llgo_14 _llgo_13: ; preds = %_llgo_12 %71 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %68) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %71) - store ptr %71, ptr @"*_llgo_main.T", align 8 + store ptr %71, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/reflect.T", align 8 br label %_llgo_14 _llgo_14: ; preds = %_llgo_13, %_llgo_12 @@ -1226,7 +1220,7 @@ _llgo_15: ; preds = %_llgo_14 %78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %76, 0 %79 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %78, i64 1, 1 %80 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %79, i64 1, 2 - %81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %80) + %81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %80) store ptr %81, ptr @"_llgo_iface$VdBKYV8-gcMjZtZfcf-u2oKoj9Lu3VXwuG8TGCW2S4A", align 8 br label %_llgo_16 @@ -1240,7 +1234,7 @@ _llgo_17: ; preds = %_llgo_16 %85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %84, 0 %86 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %85, i64 0, 1 %87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %86, i64 0, 2 - %88 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %87) + %88 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %87) store ptr %88, ptr @_llgo_any, align 8 br label %_llgo_18 @@ -1254,7 +1248,7 @@ _llgo_19: ; preds = %_llgo_18 %92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %91, 0 %93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %92, i64 0, 1 %94 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %93, i64 0, 2 - %95 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %94) + %95 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %94) %96 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.SliceOf"(ptr %95) store ptr %96, ptr @"[]_llgo_any", align 8 br label %_llgo_20 @@ -1371,8 +1365,8 @@ _llgo_22: ; preds = %_llgo_21, %_llgo_20 %171 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %168, 0 %172 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %171, i64 2, 1 %173 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %172, i64 2, 2 - %174 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %173) - store ptr %174, ptr @"main.struct$FjMjjQr3-2iTiWyZP1IIQFOz0hUCa0OS6pEm5uVV6Pk", align 8 + %174 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 50 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %173) + store ptr %174, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.struct$FjMjjQr3-2iTiWyZP1IIQFOz0hUCa0OS6pEm5uVV6Pk", align 8 %175 = load ptr, ptr @"map[_llgo_int]_llgo_string", align 8 %176 = icmp eq ptr %175, null br i1 %176, label %_llgo_23, label %_llgo_24 @@ -1403,7 +1397,7 @@ _llgo_23: ; preds = %_llgo_22 %195 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %190, 0 %196 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %195, i64 4, 1 %197 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %196, i64 4, 2 - %198 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %197) + %198 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 50 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %197) %199 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %177, ptr %178, ptr %198, i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %199) store ptr %199, ptr @"map[_llgo_int]_llgo_string", align 8 @@ -1443,9 +1437,9 @@ declare %"github.com/goplus/llgo/runtime/internal/runtime.eface" @reflect.Value. declare void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -define linkonce i64 @"__llgo_stub.main.callFunc$1"(ptr %0, i64 %1) { +define linkonce i64 @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/reflect.callFunc$1"(ptr %0, i64 %1) { _llgo_0: - %2 = tail call i64 @"main.callFunc$1"(i64 %1) + %2 = tail call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.callFunc$1"(i64 %1) ret i64 %2 } @@ -1463,9 +1457,9 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"githu declare %reflect.Value @reflect.Value.Method(%reflect.Value, i64) -define linkonce { i64, i64 } @__llgo_stub.main.demo(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10) { +define linkonce { i64, i64 } @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/reflect.demo"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10) { _llgo_0: - %11 = tail call { i64, i64 } @main.demo(i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10) + %11 = tail call { i64, i64 } @"github.com/goplus/llgo/compiler/cl/_testgo/reflect.demo"(i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10) ret { i64, i64 } %11 } @@ -1475,8 +1469,6 @@ declare %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @reflect.Value. declare void @reflect.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr, ptr, ptr, i64) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64, ptr) diff --git a/compiler/cl/_testgo/selects/out.ll b/compiler/cl/_testgo/selects/out.ll index 8b3338e8..a331fc6a 100644 --- a/compiler/cl/_testgo/selects/out.ll +++ b/compiler/cl/_testgo/selects/out.ll @@ -1,14 +1,12 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/selects' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/selects" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" = type { ptr, ptr, i32, i1 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/selects.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [4 x i8] c"c1<-", align 1 @1 = private unnamed_addr constant [4 x i8] c"<-c2", align 1 @2 = private unnamed_addr constant [4 x i8] c"<-c4", align 1 @@ -18,94 +16,90 @@ source_filename = "main" @5 = private unnamed_addr constant [4 x i8] c"c2<-", align 1 @6 = private unnamed_addr constant [4 x i8] c"<-c3", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/selects.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/selects.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/selects.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/selects.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/selects.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 0, i64 1) + store ptr %1, ptr %0, align 8 %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 0, i64 1) store ptr %3, ptr %2, align 8 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 0, i64 1) store ptr %5, ptr %4, align 8 - %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 0, i64 1) - store ptr %7, ptr %6, align 8 - %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 0, i64 1) - %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) - %10 = getelementptr inbounds { ptr, ptr, ptr }, ptr %9, i32 0, i32 0 - store ptr %2, ptr %10, align 8 - %11 = getelementptr inbounds { ptr, ptr, ptr }, ptr %9, i32 0, i32 1 - store ptr %4, ptr %11, align 8 - %12 = getelementptr inbounds { ptr, ptr, ptr }, ptr %9, i32 0, i32 2 - store ptr %6, ptr %12, align 8 - %13 = insertvalue { ptr, ptr } { ptr @"main.main$1", ptr undef }, ptr %9, 1 - %14 = call ptr @malloc(i64 16) - %15 = getelementptr inbounds { { ptr, ptr } }, ptr %14, i32 0, i32 0 - store { ptr, ptr } %13, ptr %15, align 8 - %16 = alloca i8, i64 8, align 1 - %17 = call i32 @"github.com/goplus/llgo/runtime/internal/runtime.CreateThread"(ptr %16, ptr null, ptr @"main._llgo_routine$1", ptr %14) - %18 = load ptr, ptr %2, align 8 - %19 = alloca {}, align 8 - call void @llvm.memset(ptr %19, i8 0, i64 0, i1 false) - store {} zeroinitializer, ptr %19, align 1 - %20 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.ChanSend"(ptr %18, ptr %19, i64 0) + %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 0, i64 1) + %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) + %8 = getelementptr inbounds { ptr, ptr, ptr }, ptr %7, i32 0, i32 0 + store ptr %0, ptr %8, align 8 + %9 = getelementptr inbounds { ptr, ptr, ptr }, ptr %7, i32 0, i32 1 + store ptr %2, ptr %9, align 8 + %10 = getelementptr inbounds { ptr, ptr, ptr }, ptr %7, i32 0, i32 2 + store ptr %4, ptr %10, align 8 + %11 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testgo/selects.main$1", ptr undef }, ptr %7, 1 + %12 = call ptr @malloc(i64 16) + %13 = getelementptr inbounds { { ptr, ptr } }, ptr %12, i32 0, i32 0 + store { ptr, ptr } %11, ptr %13, align 8 + %14 = alloca i8, i64 8, align 1 + %15 = call i32 @"github.com/goplus/llgo/runtime/internal/runtime.CreateThread"(ptr %14, ptr null, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/selects._llgo_routine$1", ptr %12) + %16 = load ptr, ptr %0, align 8 + %17 = alloca {}, align 8 + call void @llvm.memset(ptr %17, i8 0, i64 0, i1 false) + store {} zeroinitializer, ptr %17, align 1 + %18 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.ChanSend"(ptr %16, ptr %17, i64 0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %21 = load ptr, ptr %4, align 8 - %22 = alloca {}, align 8 - call void @llvm.memset(ptr %22, i8 0, i64 0, i1 false) - %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" undef, ptr %21, 0 - %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %23, ptr %22, 1 - %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %24, i32 0, 2 - %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %25, i1 false, 3 - %27 = alloca {}, align 8 - call void @llvm.memset(ptr %27, i8 0, i64 0, i1 false) - %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" undef, ptr %8, 0 - %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %28, ptr %27, 1 - %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %29, i32 0, 2 - %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %30, i1 false, 3 - %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) - %33 = getelementptr %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp", ptr %32, i64 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %26, ptr %33, align 8 - %34 = getelementptr %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp", ptr %32, i64 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %31, ptr %34, align 8 - %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %32, 0 - %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35, i64 2, 1 - %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36, i64 2, 2 - %38 = call { i64, i1 } @"github.com/goplus/llgo/runtime/internal/runtime.Select"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37) - %39 = extractvalue { i64, i1 } %38, 0 - %40 = extractvalue { i64, i1 } %38, 1 - %41 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %26, 1 + %19 = load ptr, ptr %2, align 8 + %20 = alloca {}, align 8 + call void @llvm.memset(ptr %20, i8 0, i64 0, i1 false) + %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" undef, ptr %19, 0 + %22 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %21, ptr %20, 1 + %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %22, i32 0, 2 + %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %23, i1 false, 3 + %25 = alloca {}, align 8 + call void @llvm.memset(ptr %25, i8 0, i64 0, i1 false) + %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" undef, ptr %6, 0 + %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %26, ptr %25, 1 + %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %27, i32 0, 2 + %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %28, i1 false, 3 + %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) + %31 = getelementptr %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp", ptr %30, i64 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %24, ptr %31, align 8 + %32 = getelementptr %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp", ptr %30, i64 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %29, ptr %32, align 8 + %33 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %30, 0 + %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %33, i64 2, 1 + %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %34, i64 2, 2 + %36 = call { i64, i1 } @"github.com/goplus/llgo/runtime/internal/runtime.Select"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35) + %37 = extractvalue { i64, i1 } %36, 0 + %38 = extractvalue { i64, i1 } %36, 1 + %39 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %24, 1 + %40 = load {}, ptr %39, align 1 + %41 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %29, 1 %42 = load {}, ptr %41, align 1 - %43 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.ChanOp" %31, 1 - %44 = load {}, ptr %43, align 1 - %45 = insertvalue { i64, i1, {}, {} } undef, i64 %39, 0 - %46 = insertvalue { i64, i1, {}, {} } %45, i1 %40, 1 - %47 = insertvalue { i64, i1, {}, {} } %46, {} %42, 2 - %48 = insertvalue { i64, i1, {}, {} } %47, {} %44, 3 - %49 = extractvalue { i64, i1, {}, {} } %48, 0 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %_llgo_2, label %_llgo_3 + %43 = insertvalue { i64, i1, {}, {} } undef, i64 %37, 0 + %44 = insertvalue { i64, i1, {}, {} } %43, i1 %38, 1 + %45 = insertvalue { i64, i1, {}, {} } %44, {} %40, 2 + %46 = insertvalue { i64, i1, {}, {} } %45, {} %42, 3 + %47 = extractvalue { i64, i1, {}, {} } %46, 0 + %48 = icmp eq i64 %47, 0 + br i1 %48, label %_llgo_2, label %_llgo_3 _llgo_1: ; preds = %_llgo_4, %_llgo_2 - ret i32 0 + ret void _llgo_2: ; preds = %_llgo_0 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }) @@ -113,8 +107,8 @@ _llgo_2: ; preds = %_llgo_0 br label %_llgo_1 _llgo_3: ; preds = %_llgo_0 - %51 = icmp eq i64 %49, 1 - br i1 %51, label %_llgo_4, label %_llgo_5 + %49 = icmp eq i64 %47, 1 + br i1 %49, label %_llgo_4, label %_llgo_5 _llgo_4: ; preds = %_llgo_3 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 4 }) @@ -122,16 +116,16 @@ _llgo_4: ; preds = %_llgo_3 br label %_llgo_1 _llgo_5: ; preds = %_llgo_3 - %52 = load ptr, ptr @_llgo_string, align 8 - %53 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 31 }, ptr %53, align 8 - %54 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %52, 0 - %55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %54, ptr %53, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %55) + %50 = load ptr, ptr @_llgo_string, align 8 + %51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 31 }, ptr %51, align 8 + %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %50, 0 + %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %52, ptr %51, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %53) unreachable } -define void @"main.main$1"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/selects.main$1"(ptr %0) { _llgo_0: %1 = load { ptr, ptr, ptr }, ptr %0, align 8 %2 = extractvalue { ptr, ptr, ptr } %1, 0 @@ -206,8 +200,6 @@ _llgo_5: ; preds = %_llgo_3 unreachable } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64, i64) @@ -216,7 +208,7 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) declare ptr @malloc(i64) -define ptr @"main._llgo_routine$1"(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testgo/selects._llgo_routine$1"(ptr %0) { _llgo_0: %1 = load { { ptr, ptr } }, ptr %0, align 8 %2 = extractvalue { { ptr, ptr } } %1, 0 @@ -242,7 +234,7 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) declare { i64, i1 } @"github.com/goplus/llgo/runtime/internal/runtime.Select"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice") -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/selects.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_string, align 8 %1 = icmp eq ptr %0, null diff --git a/compiler/cl/_testgo/strucintf/out.ll b/compiler/cl/_testgo/strucintf/out.ll index 1d238e98..0d080547 100644 --- a/compiler/cl/_testgo/strucintf/out.ll +++ b/compiler/cl/_testgo/strucintf/out.ll @@ -1,25 +1,23 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/strucintf' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/strucintf" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.init$guard" = global i1 false, align 1 @_llgo_int = linkonce global ptr null, align 8 -@"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [1 x i8] c"v", align 1 -@1 = private unnamed_addr constant [4 x i8] c"main", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@1 = private unnamed_addr constant [52 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/strucintf", align 1 @2 = private unnamed_addr constant [11 x i8] c"Foo: not ok", align 1 @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk" = linkonce global ptr null, align 8 @3 = private unnamed_addr constant [1 x i8] c"V", align 1 @4 = private unnamed_addr constant [11 x i8] c"Bar: not ok", align 1 @5 = private unnamed_addr constant [9 x i8] c"F: not ok", align 1 -define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @main.Foo() { +define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.Foo"() { _llgo_0: %0 = alloca { i64 }, align 8 call void @llvm.memset(ptr %0, i8 0, i64 8, i1 false) @@ -27,7 +25,7 @@ _llgo_0: store i64 1, ptr %1, align 4 %2 = load { i64 }, ptr %0, align 4 %3 = load ptr, ptr @_llgo_int, align 8 - %4 = load ptr, ptr @"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 + %4 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 %5 = extractvalue { i64 } %2, 0 %6 = inttoptr i64 %5 to ptr %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 @@ -35,50 +33,46 @@ _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.init$guard", align 1 call void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init"() - call void @"main.init$after"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @main.Foo() - %3 = alloca { i64 }, align 8 - call void @llvm.memset(ptr %3, i8 0, i64 8, i1 false) - %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 0 - %5 = load ptr, ptr @"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 - %6 = icmp eq ptr %4, %5 - br i1 %6, label %_llgo_10, label %_llgo_11 + %0 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.Foo"() + %1 = alloca { i64 }, align 8 + call void @llvm.memset(ptr %1, i8 0, i64 8, i1 false) + %2 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 0 + %3 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 + %4 = icmp eq ptr %2, %3 + br i1 %4, label %_llgo_10, label %_llgo_11 _llgo_1: ; preds = %_llgo_12 - %7 = getelementptr inbounds { i64 }, ptr %3, i32 0, i32 0 - %8 = load i64, ptr %7, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %8) + %5 = getelementptr inbounds { i64 }, ptr %1, i32 0, i32 0 + %6 = load i64, ptr %5, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %6) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) br label %_llgo_2 _llgo_2: ; preds = %_llgo_3, %_llgo_1 - %9 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/compiler/cl/_testdata/foo.Bar"() - %10 = alloca { i64 }, align 8 - call void @llvm.memset(ptr %10, i8 0, i64 8, i1 false) - %11 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, 0 - %12 = load ptr, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", align 8 - %13 = icmp eq ptr %11, %12 - br i1 %13, label %_llgo_13, label %_llgo_14 + %7 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/compiler/cl/_testdata/foo.Bar"() + %8 = alloca { i64 }, align 8 + call void @llvm.memset(ptr %8, i8 0, i64 8, i1 false) + %9 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, 0 + %10 = load ptr, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", align 8 + %11 = icmp eq ptr %9, %10 + br i1 %11, label %_llgo_13, label %_llgo_14 _llgo_3: ; preds = %_llgo_12 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 11 }) @@ -86,20 +80,20 @@ _llgo_3: ; preds = %_llgo_12 br label %_llgo_2 _llgo_4: ; preds = %_llgo_15 - %14 = getelementptr inbounds { i64 }, ptr %10, i32 0, i32 0 - %15 = load i64, ptr %14, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %15) + %12 = getelementptr inbounds { i64 }, ptr %8, i32 0, i32 0 + %13 = load i64, ptr %12, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %13) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) br label %_llgo_5 _llgo_5: ; preds = %_llgo_6, %_llgo_4 - %16 = alloca { i64 }, align 8 - call void @llvm.memset(ptr %16, i8 0, i64 8, i1 false) - %17 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/compiler/cl/_testdata/foo.F"() - %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %17, 0 - %19 = load ptr, ptr @"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 - %20 = icmp eq ptr %18, %19 - br i1 %20, label %_llgo_16, label %_llgo_17 + %14 = alloca { i64 }, align 8 + call void @llvm.memset(ptr %14, i8 0, i64 8, i1 false) + %15 = call %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/compiler/cl/_testdata/foo.F"() + %16 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %15, 0 + %17 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 + %18 = icmp eq ptr %16, %17 + br i1 %18, label %_llgo_16, label %_llgo_17 _llgo_6: ; preds = %_llgo_15 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 11 }) @@ -107,14 +101,14 @@ _llgo_6: ; preds = %_llgo_15 br label %_llgo_5 _llgo_7: ; preds = %_llgo_18 - %21 = getelementptr inbounds { i64 }, ptr %16, i32 0, i32 0 - %22 = load i64, ptr %21, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %22) + %19 = getelementptr inbounds { i64 }, ptr %14, i32 0, i32 0 + %20 = load i64, ptr %19, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %20) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) br label %_llgo_8 _llgo_8: ; preds = %_llgo_9, %_llgo_7 - ret i32 0 + ret void _llgo_9: ; preds = %_llgo_18 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 9 }) @@ -122,64 +116,64 @@ _llgo_9: ; preds = %_llgo_18 br label %_llgo_8 _llgo_10: ; preds = %_llgo_0 - %23 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 1 - %24 = ptrtoint ptr %23 to i64 - %25 = insertvalue { i64 } undef, i64 %24, 0 - %26 = insertvalue { { i64 }, i1 } undef, { i64 } %25, 0 - %27 = insertvalue { { i64 }, i1 } %26, i1 true, 1 + %21 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 1 + %22 = ptrtoint ptr %21 to i64 + %23 = insertvalue { i64 } undef, i64 %22, 0 + %24 = insertvalue { { i64 }, i1 } undef, { i64 } %23, 0 + %25 = insertvalue { { i64 }, i1 } %24, i1 true, 1 br label %_llgo_12 _llgo_11: ; preds = %_llgo_0 br label %_llgo_12 _llgo_12: ; preds = %_llgo_11, %_llgo_10 - %28 = phi { { i64 }, i1 } [ %27, %_llgo_10 ], [ zeroinitializer, %_llgo_11 ] - %29 = extractvalue { { i64 }, i1 } %28, 0 - store { i64 } %29, ptr %3, align 4 - %30 = extractvalue { { i64 }, i1 } %28, 1 - br i1 %30, label %_llgo_1, label %_llgo_3 + %26 = phi { { i64 }, i1 } [ %25, %_llgo_10 ], [ zeroinitializer, %_llgo_11 ] + %27 = extractvalue { { i64 }, i1 } %26, 0 + store { i64 } %27, ptr %1, align 4 + %28 = extractvalue { { i64 }, i1 } %26, 1 + br i1 %28, label %_llgo_1, label %_llgo_3 _llgo_13: ; preds = %_llgo_2 - %31 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, 1 - %32 = ptrtoint ptr %31 to i64 - %33 = insertvalue { i64 } undef, i64 %32, 0 - %34 = insertvalue { { i64 }, i1 } undef, { i64 } %33, 0 - %35 = insertvalue { { i64 }, i1 } %34, i1 true, 1 + %29 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, 1 + %30 = ptrtoint ptr %29 to i64 + %31 = insertvalue { i64 } undef, i64 %30, 0 + %32 = insertvalue { { i64 }, i1 } undef, { i64 } %31, 0 + %33 = insertvalue { { i64 }, i1 } %32, i1 true, 1 br label %_llgo_15 _llgo_14: ; preds = %_llgo_2 br label %_llgo_15 _llgo_15: ; preds = %_llgo_14, %_llgo_13 - %36 = phi { { i64 }, i1 } [ %35, %_llgo_13 ], [ zeroinitializer, %_llgo_14 ] - %37 = extractvalue { { i64 }, i1 } %36, 0 - store { i64 } %37, ptr %10, align 4 - %38 = extractvalue { { i64 }, i1 } %36, 1 - br i1 %38, label %_llgo_4, label %_llgo_6 + %34 = phi { { i64 }, i1 } [ %33, %_llgo_13 ], [ zeroinitializer, %_llgo_14 ] + %35 = extractvalue { { i64 }, i1 } %34, 0 + store { i64 } %35, ptr %8, align 4 + %36 = extractvalue { { i64 }, i1 } %34, 1 + br i1 %36, label %_llgo_4, label %_llgo_6 _llgo_16: ; preds = %_llgo_5 - %39 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %17, 1 - %40 = ptrtoint ptr %39 to i64 - %41 = insertvalue { i64 } undef, i64 %40, 0 - %42 = insertvalue { { i64 }, i1 } undef, { i64 } %41, 0 - %43 = insertvalue { { i64 }, i1 } %42, i1 true, 1 + %37 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %15, 1 + %38 = ptrtoint ptr %37 to i64 + %39 = insertvalue { i64 } undef, i64 %38, 0 + %40 = insertvalue { { i64 }, i1 } undef, { i64 } %39, 0 + %41 = insertvalue { { i64 }, i1 } %40, i1 true, 1 br label %_llgo_18 _llgo_17: ; preds = %_llgo_5 br label %_llgo_18 _llgo_18: ; preds = %_llgo_17, %_llgo_16 - %44 = phi { { i64 }, i1 } [ %43, %_llgo_16 ], [ zeroinitializer, %_llgo_17 ] - %45 = extractvalue { { i64 }, i1 } %44, 0 - store { i64 } %45, ptr %16, align 4 - %46 = extractvalue { { i64 }, i1 } %44, 1 - br i1 %46, label %_llgo_7, label %_llgo_9 + %42 = phi { { i64 }, i1 } [ %41, %_llgo_16 ], [ zeroinitializer, %_llgo_17 ] + %43 = extractvalue { { i64 }, i1 } %42, 0 + store { i64 } %43, ptr %14, align 4 + %44 = extractvalue { { i64 }, i1 } %42, 1 + br i1 %44, label %_llgo_7, label %_llgo_9 } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = icmp eq ptr %0, null @@ -199,8 +193,8 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %5, 0 %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 1, 1 %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 1, 2 - %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) - store ptr %10, ptr @"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 + %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 52 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) + store ptr %10, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/strucintf.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 %11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34) %12 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 1 }, ptr %11, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56) @@ -209,7 +203,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %13, 0 %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %15, i64 1, 1 %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16, i64 1, 2 - %18 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17) + %18 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 52 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17) store ptr %18, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", align 8 ret void } @@ -224,8 +218,6 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) declare void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testgo/struczero/out.ll b/compiler/cl/_testgo/struczero/out.ll index c4217937..a216b5e0 100644 --- a/compiler/cl/_testgo/struczero/out.ll +++ b/compiler/cl/_testgo/struczero/out.ll @@ -1,36 +1,34 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/struczero' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/struczero" %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" = type { ptr, float } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -%main.bar = type { ptr, float } +%"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar" = type { ptr, float } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/struczero.init$guard" = global i1 false, align 1 @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [48 x i8] c"github.com/goplus/llgo/compiler/cl/_testdata/foo", align 1 @1 = private unnamed_addr constant [3 x i8] c"Foo", align 1 @_llgo_byte = linkonce global ptr null, align 8 @"*_llgo_byte" = linkonce global ptr null, align 8 @_llgo_float32 = linkonce global ptr null, align 8 -@"main.struct$qQwZyFy_4JRalRxVVsVD8R09X5t58tWjTrtJPtHbEjs" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/struczero.struct$qQwZyFy_4JRalRxVVsVD8R09X5t58tWjTrtJPtHbEjs" = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [2 x i8] c"pb", align 1 @3 = private unnamed_addr constant [1 x i8] c"F", align 1 -@4 = private unnamed_addr constant [4 x i8] c"main", align 1 +@4 = private unnamed_addr constant [52 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/struczero", align 1 @5 = private unnamed_addr constant [2 x i8] c"Pb", align 1 @"_llgo_func$NfGSLZ1QiKRoFkKeqYSXE5hUU5bpeteSJKrbMNUzYRE" = linkonce global ptr null, align 8 -@_llgo_main.bar = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar" = linkonce global ptr null, align 8 @6 = private unnamed_addr constant [3 x i8] c"bar", align 1 -@"main.struct$Ci43nzKYkRLddRL_N4mkykxLXfJlqJGS5n04LKThPNo" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/struczero.struct$Ci43nzKYkRLddRL_N4mkykxLXfJlqJGS5n04LKThPNo" = linkonce global ptr null, align 8 @7 = private unnamed_addr constant [1 x i8] c"f", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @8 = private unnamed_addr constant [6 x i8] c"notOk:", align 1 -define { %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", i1 } @main.Bar(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define { %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", i1 } @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.Bar"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 0 %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", align 8 @@ -56,99 +54,95 @@ _llgo_3: ; preds = %_llgo_2, %_llgo_1 ret { %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", i1 } %12 } -define { %main.bar, i1 } @main.Foo(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.Foo"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 0 - %2 = load ptr, ptr @_llgo_main.bar, align 8 + %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", align 8 %3 = icmp eq ptr %1, %2 br i1 %3, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 1 - %5 = load %main.bar, ptr %4, align 8 - %6 = insertvalue { %main.bar, i1 } undef, %main.bar %5, 0 - %7 = insertvalue { %main.bar, i1 } %6, i1 true, 1 + %5 = load %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", ptr %4, align 8 + %6 = insertvalue { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } undef, %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar" %5, 0 + %7 = insertvalue { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } %6, i1 true, 1 br label %_llgo_3 _llgo_2: ; preds = %_llgo_0 br label %_llgo_3 _llgo_3: ; preds = %_llgo_2, %_llgo_1 - %8 = phi { %main.bar, i1 } [ %7, %_llgo_1 ], [ zeroinitializer, %_llgo_2 ] - %9 = extractvalue { %main.bar, i1 } %8, 0 - %10 = extractvalue { %main.bar, i1 } %8, 1 - %11 = insertvalue { %main.bar, i1 } undef, %main.bar %9, 0 - %12 = insertvalue { %main.bar, i1 } %11, i1 %10, 1 - ret { %main.bar, i1 } %12 + %8 = phi { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } [ %7, %_llgo_1 ], [ zeroinitializer, %_llgo_2 ] + %9 = extractvalue { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } %8, 0 + %10 = extractvalue { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } %8, 1 + %11 = insertvalue { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } undef, %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar" %9, 0 + %12 = insertvalue { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } %11, i1 %10, 1 + ret { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } %12 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.init$guard", align 1 call void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init"() - call void @"main.init$after"() + call void @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = alloca %main.bar, align 8 - call void @llvm.memset(ptr %2, i8 0, i64 16, i1 false) - %3 = call { %main.bar, i1 } @main.Foo(%"github.com/goplus/llgo/runtime/internal/runtime.eface" zeroinitializer) - %4 = extractvalue { %main.bar, i1 } %3, 0 - store %main.bar %4, ptr %2, align 8 - %5 = extractvalue { %main.bar, i1 } %3, 1 - %6 = getelementptr inbounds %main.bar, ptr %2, i32 0, i32 0 - %7 = load ptr, ptr %6, align 8 - %8 = getelementptr inbounds %main.bar, ptr %2, i32 0, i32 1 - %9 = load float, ptr %8, align 4 - %10 = xor i1 %5, true - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %7) + %0 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", align 8 + call void @llvm.memset(ptr %0, i8 0, i64 16, i1 false) + %1 = call { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.Foo"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" zeroinitializer) + %2 = extractvalue { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } %1, 0 + store %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar" %2, ptr %0, align 8 + %3 = extractvalue { %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", i1 } %1, 1 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", ptr %0, i32 0, i32 0 + %5 = load ptr, ptr %4, align 8 + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", ptr %0, i32 0, i32 1 + %7 = load float, ptr %6, align 4 + %8 = xor i1 %3, true + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %5) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %11 = fpext float %9 to double - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %11) + %9 = fpext float %7 to double + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %9) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 6 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %10) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %8) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %12 = alloca %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", align 8 - call void @llvm.memset(ptr %12, i8 0, i64 16, i1 false) - %13 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", align 8 - %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" zeroinitializer, ptr %14, align 8 - %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %13, 0 - %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %15, ptr %14, 1 - %17 = call { %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", i1 } @main.Bar(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %16) - %18 = extractvalue { %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", i1 } %17, 0 - store %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" %18, ptr %12, align 8 - %19 = extractvalue { %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", i1 } %17, 1 - %20 = load %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", ptr %12, align 8 - %21 = call ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo.Pb"(%"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" %20) - %22 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", ptr %12, i32 0, i32 1 - %23 = load float, ptr %22, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %21) + %10 = alloca %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", align 8 + call void @llvm.memset(ptr %10, i8 0, i64 16, i1 false) + %11 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", align 8 + %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" zeroinitializer, ptr %12, align 8 + %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %11, 0 + %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, ptr %12, 1 + %15 = call { %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", i1 } @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.Bar"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %14) + %16 = extractvalue { %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", i1 } %15, 0 + store %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" %16, ptr %10, align 8 + %17 = extractvalue { %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", i1 } %15, 1 + %18 = load %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", ptr %10, align 8 + %19 = call ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo.Pb"(%"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" %18) + %20 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", ptr %10, i32 0, i32 1 + %21 = load float, ptr %20, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %19) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %24 = fpext float %23 to double - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %24) + %22 = fpext float %21 to double + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %22) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %19) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %17) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.init$after"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 3 }, i64 25, i64 16, i64 1, i64 1) %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", align 8 @@ -208,9 +202,9 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_6 %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %21, 0 %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %24, i64 2, 1 %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %25, i64 2, 2 - %27 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %26) - store ptr %27, ptr @"main.struct$qQwZyFy_4JRalRxVVsVD8R09X5t58tWjTrtJPtHbEjs", align 8 - %28 = load ptr, ptr @"main.struct$qQwZyFy_4JRalRxVVsVD8R09X5t58tWjTrtJPtHbEjs", align 8 + %27 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 52 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %26) + store ptr %27, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.struct$qQwZyFy_4JRalRxVVsVD8R09X5t58tWjTrtJPtHbEjs", align 8 + %28 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.struct$qQwZyFy_4JRalRxVVsVD8R09X5t58tWjTrtJPtHbEjs", align 8 br i1 %2, label %_llgo_9, label %_llgo_10 _llgo_9: ; preds = %_llgo_8 @@ -221,8 +215,8 @@ _llgo_9: ; preds = %_llgo_8 br i1 %32, label %_llgo_11, label %_llgo_12 _llgo_10: ; preds = %_llgo_12, %_llgo_8 - %33 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 3 }, i64 25, i64 16, i64 0, i64 0) - store ptr %33, ptr @_llgo_main.bar, align 8 + %33 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 52 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 3 }, i64 25, i64 16, i64 0, i64 0) + store ptr %33, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/struczero.bar", align 8 %34 = load ptr, ptr @"*_llgo_byte", align 8 %35 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 40) %36 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %35) @@ -237,9 +231,9 @@ _llgo_10: ; preds = %_llgo_12, %_llgo_8 %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %40, 0 %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %43, i64 2, 1 %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %44, i64 2, 2 - %46 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %45) - store ptr %46, ptr @"main.struct$Ci43nzKYkRLddRL_N4mkykxLXfJlqJGS5n04LKThPNo", align 8 - %47 = load ptr, ptr @"main.struct$Ci43nzKYkRLddRL_N4mkykxLXfJlqJGS5n04LKThPNo", align 8 + %46 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 52 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %45) + store ptr %46, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.struct$Ci43nzKYkRLddRL_N4mkykxLXfJlqJGS5n04LKThPNo", align 8 + %47 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/struczero.struct$Ci43nzKYkRLddRL_N4mkykxLXfJlqJGS5n04LKThPNo", align 8 call void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr %33, ptr %47, { ptr, i64, i64 } zeroinitializer, { ptr, i64, i64 } zeroinitializer) ret void @@ -307,8 +301,6 @@ declare ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo.Pb"(%"github. declare void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0 diff --git a/compiler/cl/_testgo/tpindex/out.ll b/compiler/cl/_testgo/tpindex/out.ll index cbbf1fc9..f208ac85 100644 --- a/compiler/cl/_testgo/tpindex/out.ll +++ b/compiler/cl/_testgo/tpindex/out.ll @@ -1,59 +1,51 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/tpindex' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/tpindex" %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/tpindex.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tpindex.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpindex.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpindex.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tpindex.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) - %3 = getelementptr inbounds i64, ptr %2, i64 0 - store i64 1, ptr %3, align 4 - %4 = getelementptr inbounds i64, ptr %2, i64 1 - store i64 3, ptr %4, align 4 - %5 = getelementptr inbounds i64, ptr %2, i64 2 - store i64 5, ptr %5, align 4 - %6 = getelementptr inbounds i64, ptr %2, i64 3 - store i64 2, ptr %6, align 4 - %7 = getelementptr inbounds i64, ptr %2, i64 4 - store i64 4, ptr %7, align 4 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 5, 1 - %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, i64 5, 2 - %11 = call i64 @"main.index[int]"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10, i64 3) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %11) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) + %1 = getelementptr inbounds i64, ptr %0, i64 0 + store i64 1, ptr %1, align 4 + %2 = getelementptr inbounds i64, ptr %0, i64 1 + store i64 3, ptr %2, align 4 + %3 = getelementptr inbounds i64, ptr %0, i64 2 + store i64 5, ptr %3, align 4 + %4 = getelementptr inbounds i64, ptr %0, i64 3 + store i64 2, ptr %4, align 4 + %5 = getelementptr inbounds i64, ptr %0, i64 4 + store i64 4, ptr %5, align 4 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, i64 5, 1 + %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 5, 2 + %9 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tpindex.index[int]"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 3) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %9) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %12 = call i64 @"main.index[int]"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10, i64 6) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %12) + %10 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tpindex.index[int]"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 6) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %10) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define linkonce i64 @"main.index[int]"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, i64 %1) { +define linkonce i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tpindex.index[int]"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, i64 %1) { _llgo_0: %2 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, 1 br label %_llgo_1 diff --git a/compiler/cl/_testgo/tpinst/out.ll b/compiler/cl/_testgo/tpinst/out.ll index 6258adfd..c1ef8a9e 100644 --- a/compiler/cl/_testgo/tpinst/out.ll +++ b/compiler/cl/_testgo/tpinst/out.ll @@ -1,50 +1,48 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/tpinst' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/tpinst" -%"main.M[int]" = type { i64 } +%"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]" = type { i64 } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -%"main.M[float64]" = type { double } +%"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]" = type { double } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } %"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } -@"main.init$guard" = global i1 false, align 1 -@"_llgo_main.M[int]" = linkonce global ptr null, align 8 -@0 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.init$guard" = global i1 false, align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]" = linkonce global ptr null, align 8 +@0 = private unnamed_addr constant [49 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/tpinst", align 1 @1 = private unnamed_addr constant [6 x i8] c"M[int]", align 1 @_llgo_int = linkonce global ptr null, align 8 -@"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [1 x i8] c"v", align 1 @3 = private unnamed_addr constant [5 x i8] c"Value", align 1 @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA" = linkonce global ptr null, align 8 @4 = private unnamed_addr constant [5 x i8] c"value", align 1 -@5 = private unnamed_addr constant [10 x i8] c"main.value", align 1 -@"*_llgo_main.M[int]" = linkonce global ptr null, align 8 +@5 = private unnamed_addr constant [55 x i8] c"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.value", align 1 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]" = linkonce global ptr null, align 8 @"_llgo_iface$Jvxc0PCI_drlfK7S5npMGdZkQLeRkQ_x2e2CifPE6w8" = linkonce global ptr null, align 8 @6 = private unnamed_addr constant [5 x i8] c"error", align 1 @_llgo_string = linkonce global ptr null, align 8 -@"_llgo_main.M[float64]" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]" = linkonce global ptr null, align 8 @7 = private unnamed_addr constant [10 x i8] c"M[float64]", align 1 @_llgo_float64 = linkonce global ptr null, align 8 -@"main.struct$7SZ-TjG6e68olyGxlMRRIOYuZz2LaKIpOrZH-w4GiTU" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.struct$7SZ-TjG6e68olyGxlMRRIOYuZz2LaKIpOrZH-w4GiTU" = linkonce global ptr null, align 8 @"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8" = linkonce global ptr null, align 8 -@"*_llgo_main.M[float64]" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]" = linkonce global ptr null, align 8 @"_llgo_iface$2dxw6yZ6V86Spb7J0dTDIoWqg7ba7UDXlAlpJv3-HLk" = linkonce global ptr null, align 8 -@"main.iface$2sV9fFeqOv1SzesvwIdhTqCFzDT8ZX5buKUSAoHNSww" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.iface$2sV9fFeqOv1SzesvwIdhTqCFzDT8ZX5buKUSAoHNSww" = linkonce global ptr null, align 8 @8 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -define void @main.demo() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.demo"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %1 = getelementptr inbounds %"main.M[int]", ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]", ptr %0, i32 0, i32 0 store i64 100, ptr %1, align 4 - %2 = load ptr, ptr @"_llgo_main.M[int]", align 8 - %3 = load ptr, ptr @"*_llgo_main.M[int]", align 8 + %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]", align 8 + %3 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]", align 8 %4 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %5 = load ptr, ptr @"_llgo_iface$Jvxc0PCI_drlfK7S5npMGdZkQLeRkQ_x2e2CifPE6w8", align 8 %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %5, ptr %3) @@ -73,10 +71,10 @@ _llgo_1: ; preds = %_llgo_0 _llgo_2: ; preds = %_llgo_0 %23 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %24 = getelementptr inbounds %"main.M[float64]", ptr %23, i32 0, i32 0 + %24 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]", ptr %23, i32 0, i32 0 store double 1.001000e+02, ptr %24, align 8 - %25 = load ptr, ptr @"_llgo_main.M[float64]", align 8 - %26 = load ptr, ptr @"*_llgo_main.M[float64]", align 8 + %25 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]", align 8 + %26 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]", align 8 %27 = load ptr, ptr @"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8", align 8 %28 = load ptr, ptr @"_llgo_iface$2dxw6yZ6V86Spb7J0dTDIoWqg7ba7UDXlAlpJv3-HLk", align 8 %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %28, ptr %26) @@ -106,7 +104,7 @@ _llgo_3: ; preds = %_llgo_2 _llgo_4: ; preds = %_llgo_2 %46 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %8) %47 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 - %48 = load ptr, ptr @"main.iface$2sV9fFeqOv1SzesvwIdhTqCFzDT8ZX5buKUSAoHNSww", align 8 + %48 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.iface$2sV9fFeqOv1SzesvwIdhTqCFzDT8ZX5buKUSAoHNSww", align 8 %49 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr %48, ptr %46) br i1 %49, label %_llgo_7, label %_llgo_8 @@ -124,7 +122,7 @@ _llgo_6: ; preds = %_llgo_7 _llgo_7: ; preds = %_llgo_4 %54 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %8, 1 - %55 = load ptr, ptr @"main.iface$2sV9fFeqOv1SzesvwIdhTqCFzDT8ZX5buKUSAoHNSww", align 8 + %55 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.iface$2sV9fFeqOv1SzesvwIdhTqCFzDT8ZX5buKUSAoHNSww", align 8 %56 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %55, ptr %46) %57 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %56, 0 %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %57, ptr %54, 1 @@ -150,69 +148,65 @@ _llgo_8: ; preds = %_llgo_4 unreachable } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.demo() - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.demo"() + ret void } -define linkonce double @"main.(*M[float64]).Value"(ptr %0) { +define linkonce double @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[float64]).Value"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %"main.M[float64]", ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]", ptr %0, i32 0, i32 0 %2 = load double, ptr %1, align 8 ret double %2 } -define linkonce double @"main.(*M[float64]).value"(ptr %0) { +define linkonce double @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[float64]).value"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %"main.M[float64]", ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]", ptr %0, i32 0, i32 0 %2 = load double, ptr %1, align 8 ret double %2 } -define linkonce i64 @"main.(*M[int]).Value"(ptr %0) { +define linkonce i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[int]).Value"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %"main.M[int]", ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]", ptr %0, i32 0, i32 0 %2 = load i64, ptr %1, align 4 ret i64 %2 } -define linkonce i64 @"main.(*M[int]).value"(ptr %0) { +define linkonce i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[int]).value"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %"main.M[int]", ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]", ptr %0, i32 0, i32 0 %2 = load i64, ptr %1, align 4 ret i64 %2 } declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 6 }, i64 25, i64 8, i64 0, i64 2) - %1 = load ptr, ptr @"_llgo_main.M[int]", align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 6 }, i64 25, i64 8, i64 0, i64 2) + %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]", align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %0, ptr @"_llgo_main.M[int]", align 8 + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 @@ -235,9 +229,9 @@ _llgo_4: ; preds = %_llgo_3, %_llgo_2 %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %9, 0 %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %11, i64 1, 1 %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %12, i64 1, 2 - %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %13) - store ptr %14, ptr @"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 - %15 = load ptr, ptr @"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 + %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %13) + store ptr %14, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 + %15 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 br i1 %2, label %_llgo_5, label %_llgo_6 _llgo_5: ; preds = %_llgo_4 @@ -247,8 +241,8 @@ _llgo_5: ; preds = %_llgo_4 br i1 %18, label %_llgo_7, label %_llgo_8 _llgo_6: ; preds = %_llgo_8, %_llgo_4 - %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 6 }, i64 25, i64 8, i64 0, i64 2) - %20 = load ptr, ptr @"*_llgo_main.M[int]", align 8 + %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 6 }, i64 25, i64 8, i64 0, i64 2) + %20 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]", align 8 %21 = icmp eq ptr %20, null br i1 %21, label %_llgo_9, label %_llgo_10 @@ -271,12 +265,12 @@ _llgo_7: ; preds = %_llgo_5 _llgo_8: ; preds = %_llgo_7, %_llgo_5 %32 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 %33 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 5 }, ptr undef, ptr undef, ptr undef }, ptr %32, 1 - %34 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %33, ptr @"main.(*M[int]).Value", 2 - %35 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %34, ptr @"main.(*M[int]).Value", 3 + %34 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %33, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[int]).Value", 2 + %35 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %34, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[int]).Value", 3 %36 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 - %37 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 10 }, ptr undef, ptr undef, ptr undef }, ptr %36, 1 - %38 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %37, ptr @"main.(*M[int]).value", 2 - %39 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %38, ptr @"main.(*M[int]).value", 3 + %37 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 55 }, ptr undef, ptr undef, ptr undef }, ptr %36, 1 + %38 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %37, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[int]).value", 2 + %39 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %38, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[int]).value", 3 %40 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 80) %41 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %40, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %35, ptr %41, align 8 @@ -291,7 +285,7 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_5 _llgo_9: ; preds = %_llgo_6 %46 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %19) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %46) - store ptr %46, ptr @"*_llgo_main.M[int]", align 8 + store ptr %46, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[int]", align 8 br label %_llgo_10 _llgo_10: ; preds = %_llgo_9, %_llgo_6 @@ -308,7 +302,7 @@ _llgo_11: ; preds = %_llgo_10 %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %51, 0 %54 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %53, i64 1, 1 %55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %54, i64 1, 2 - %56 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %55) + %56 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %55) store ptr %56, ptr @"_llgo_iface$Jvxc0PCI_drlfK7S5npMGdZkQLeRkQ_x2e2CifPE6w8", align 8 br label %_llgo_12 @@ -323,13 +317,13 @@ _llgo_13: ; preds = %_llgo_12 br label %_llgo_14 _llgo_14: ; preds = %_llgo_13, %_llgo_12 - %60 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 10 }, i64 25, i64 8, i64 0, i64 2) - %61 = load ptr, ptr @"_llgo_main.M[float64]", align 8 + %60 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 10 }, i64 25, i64 8, i64 0, i64 2) + %61 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]", align 8 %62 = icmp eq ptr %61, null br i1 %62, label %_llgo_15, label %_llgo_16 _llgo_15: ; preds = %_llgo_14 - store ptr %60, ptr @"_llgo_main.M[float64]", align 8 + store ptr %60, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]", align 8 br label %_llgo_16 _llgo_16: ; preds = %_llgo_15, %_llgo_14 @@ -352,9 +346,9 @@ _llgo_18: ; preds = %_llgo_17, %_llgo_16 %71 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %69, 0 %72 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %71, i64 1, 1 %73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %72, i64 1, 2 - %74 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %73) - store ptr %74, ptr @"main.struct$7SZ-TjG6e68olyGxlMRRIOYuZz2LaKIpOrZH-w4GiTU", align 8 - %75 = load ptr, ptr @"main.struct$7SZ-TjG6e68olyGxlMRRIOYuZz2LaKIpOrZH-w4GiTU", align 8 + %74 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %73) + store ptr %74, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.struct$7SZ-TjG6e68olyGxlMRRIOYuZz2LaKIpOrZH-w4GiTU", align 8 + %75 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.struct$7SZ-TjG6e68olyGxlMRRIOYuZz2LaKIpOrZH-w4GiTU", align 8 br i1 %62, label %_llgo_19, label %_llgo_20 _llgo_19: ; preds = %_llgo_18 @@ -364,8 +358,8 @@ _llgo_19: ; preds = %_llgo_18 br i1 %78, label %_llgo_21, label %_llgo_22 _llgo_20: ; preds = %_llgo_22, %_llgo_18 - %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 10 }, i64 25, i64 8, i64 0, i64 2) - %80 = load ptr, ptr @"*_llgo_main.M[float64]", align 8 + %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 10 }, i64 25, i64 8, i64 0, i64 2) + %80 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]", align 8 %81 = icmp eq ptr %80, null br i1 %81, label %_llgo_23, label %_llgo_24 @@ -388,12 +382,12 @@ _llgo_21: ; preds = %_llgo_19 _llgo_22: ; preds = %_llgo_21, %_llgo_19 %92 = load ptr, ptr @"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8", align 8 %93 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 5 }, ptr undef, ptr undef, ptr undef }, ptr %92, 1 - %94 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %93, ptr @"main.(*M[float64]).Value", 2 - %95 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %94, ptr @"main.(*M[float64]).Value", 3 + %94 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %93, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[float64]).Value", 2 + %95 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %94, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[float64]).Value", 3 %96 = load ptr, ptr @"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8", align 8 - %97 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 10 }, ptr undef, ptr undef, ptr undef }, ptr %96, 1 - %98 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %97, ptr @"main.(*M[float64]).value", 2 - %99 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %98, ptr @"main.(*M[float64]).value", 3 + %97 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 55 }, ptr undef, ptr undef, ptr undef }, ptr %96, 1 + %98 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %97, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[float64]).value", 2 + %99 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %98, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.(*M[float64]).value", 3 %100 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 80) %101 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %100, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %95, ptr %101, align 8 @@ -408,7 +402,7 @@ _llgo_22: ; preds = %_llgo_21, %_llgo_19 _llgo_23: ; preds = %_llgo_20 %106 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %79) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %106) - store ptr %106, ptr @"*_llgo_main.M[float64]", align 8 + store ptr %106, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testgo/tpinst.M[float64]", align 8 br label %_llgo_24 _llgo_24: ; preds = %_llgo_23, %_llgo_20 @@ -425,21 +419,21 @@ _llgo_25: ; preds = %_llgo_24 %113 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %111, 0 %114 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %113, i64 1, 1 %115 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %114, i64 1, 2 - %116 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %115) + %116 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %115) store ptr %116, ptr @"_llgo_iface$2dxw6yZ6V86Spb7J0dTDIoWqg7ba7UDXlAlpJv3-HLk", align 8 br label %_llgo_26 _llgo_26: ; preds = %_llgo_25, %_llgo_24 %117 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 - %118 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 10 }, ptr undef }, ptr %117, 1 + %118 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 55 }, ptr undef }, ptr %117, 1 %119 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) %120 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %119, i64 0 store %"github.com/goplus/llgo/runtime/abi.Imethod" %118, ptr %120, align 8 %121 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %119, 0 %122 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %121, i64 1, 1 %123 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %122, i64 1, 2 - %124 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %123) - store ptr %124, ptr @"main.iface$2sV9fFeqOv1SzesvwIdhTqCFzDT8ZX5buKUSAoHNSww", align 8 + %124 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 49 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %123) + store ptr %124, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpinst.iface$2sV9fFeqOv1SzesvwIdhTqCFzDT8ZX5buKUSAoHNSww", align 8 ret void } @@ -472,5 +466,3 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.c declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface") declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.Implements"(ptr, ptr) - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testgo/tpnamed/out.ll b/compiler/cl/_testgo/tpnamed/out.ll index f726cec4..5a447d1b 100644 --- a/compiler/cl/_testgo/tpnamed/out.ll +++ b/compiler/cl/_testgo/tpnamed/out.ll @@ -1,98 +1,90 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/tpnamed' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/tpnamed" -%"main.IO[error]" = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.IO[error]" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%"main.Future[error]" = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[error]" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } -%"main.IO[[0]byte]" = type { ptr, ptr } -%"main.Future[[0]byte]" = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.IO[[0]byte]" = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[[0]byte]" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.init$guard" = global i1 false, align 1 -define %"main.IO[error]" @main.WriteFile(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { +define %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.IO[error]" @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.WriteFile"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { _llgo_0: - ret %"main.IO[error]" { ptr @"__llgo_stub.main.WriteFile$1", ptr null } + ret %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.IO[error]" { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.WriteFile$1", ptr null } } -define %"main.Future[error]" @"main.WriteFile$1"() { +define %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[error]" @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.WriteFile$1"() { _llgo_0: - ret %"main.Future[error]" { ptr @"__llgo_stub.main.WriteFile$1$1", ptr null } + ret %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[error]" { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.WriteFile$1$1", ptr null } } -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.WriteFile$1$1"() { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.WriteFile$1$1"() { _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call [0 x i8] @"main.RunIO[[0]byte]"(%"main.IO[[0]byte]" { ptr @"__llgo_stub.main.main$1", ptr null }) - ret i32 0 + %0 = call [0 x i8] @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.RunIO[[0]byte]"(%"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.IO[[0]byte]" { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.main$1", ptr null }) + ret void } -define %"main.Future[[0]byte]" @"main.main$1"() { +define %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[[0]byte]" @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.main$1"() { _llgo_0: - ret %"main.Future[[0]byte]" { ptr @"__llgo_stub.main.main$1$1", ptr null } + ret %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[[0]byte]" { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.main$1$1", ptr null } } -define [0 x i8] @"main.main$1$1"() { +define [0 x i8] @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.main$1$1"() { _llgo_0: ret [0 x i8] zeroinitializer } -define linkonce %"main.Future[error]" @"__llgo_stub.main.WriteFile$1"(ptr %0) { +define linkonce %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[error]" @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.WriteFile$1"(ptr %0) { _llgo_0: - %1 = tail call %"main.Future[error]" @"main.WriteFile$1"() - ret %"main.Future[error]" %1 + %1 = tail call %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[error]" @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.WriteFile$1"() + ret %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[error]" %1 } -define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"__llgo_stub.main.WriteFile$1$1"(ptr %0) { +define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.WriteFile$1$1"(ptr %0) { _llgo_0: - %1 = tail call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.WriteFile$1$1"() + %1 = tail call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.WriteFile$1$1"() ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define linkonce %"main.Future[[0]byte]" @"__llgo_stub.main.main$1"(ptr %0) { +define linkonce %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[[0]byte]" @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.main$1"(ptr %0) { _llgo_0: - %1 = tail call %"main.Future[[0]byte]" @"main.main$1"() - ret %"main.Future[[0]byte]" %1 + %1 = tail call %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[[0]byte]" @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.main$1"() + ret %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[[0]byte]" %1 } -define linkonce [0 x i8] @"main.RunIO[[0]byte]"(%"main.IO[[0]byte]" %0) { +define linkonce [0 x i8] @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.RunIO[[0]byte]"(%"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.IO[[0]byte]" %0) { _llgo_0: - %1 = extractvalue %"main.IO[[0]byte]" %0, 1 - %2 = extractvalue %"main.IO[[0]byte]" %0, 0 - %3 = call %"main.Future[[0]byte]" %2(ptr %1) - %4 = extractvalue %"main.Future[[0]byte]" %3, 1 - %5 = extractvalue %"main.Future[[0]byte]" %3, 0 + %1 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.IO[[0]byte]" %0, 1 + %2 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.IO[[0]byte]" %0, 0 + %3 = call %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[[0]byte]" %2(ptr %1) + %4 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[[0]byte]" %3, 1 + %5 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.Future[[0]byte]" %3, 0 %6 = call [0 x i8] %5(ptr %4) ret [0 x i8] %6 } -define linkonce [0 x i8] @"__llgo_stub.main.main$1$1"(ptr %0) { +define linkonce [0 x i8] @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.main$1$1"(ptr %0) { _llgo_0: - %1 = tail call [0 x i8] @"main.main$1$1"() + %1 = tail call [0 x i8] @"github.com/goplus/llgo/compiler/cl/_testgo/tpnamed.main$1$1"() ret [0 x i8] %1 } diff --git a/compiler/cl/_testgo/tprecur/out.ll b/compiler/cl/_testgo/tprecur/out.ll index 4e8654a0..3be81881 100644 --- a/compiler/cl/_testgo/tprecur/out.ll +++ b/compiler/cl/_testgo/tprecur/out.ll @@ -1,43 +1,37 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/tprecur' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/tprecur" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [5 x i8] c"error", align 1 @_llgo_string = linkonce global ptr null, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.recursive() - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.recursive"() + ret void } -define void @main.recursive() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.recursive"() { _llgo_0: - %0 = call i64 @"main.recur1[main.T]"(i64 5) + %0 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.recur1[github.com/goplus/llgo/compiler/cl/_testgo/tprecur.T]"(i64 5) %1 = icmp ne i64 %0, 110 br i1 %1, label %_llgo_1, label %_llgo_2 @@ -54,9 +48,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define linkonce i64 @"main.recur1[main.T]"(i64 %0) { +define linkonce i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.recur1[github.com/goplus/llgo/compiler/cl/_testgo/tprecur.T]"(i64 %0) { _llgo_0: %1 = icmp eq i64 %0, 0 br i1 %1, label %_llgo_1, label %_llgo_3 @@ -66,7 +58,7 @@ _llgo_1: ; preds = %_llgo_3, %_llgo_0 _llgo_2: ; preds = %_llgo_3 %2 = sub i64 %0, 1 - %3 = call i64 @"main.recur2[main.T]"(i64 %2) + %3 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.recur2[github.com/goplus/llgo/compiler/cl/_testgo/tprecur.T]"(i64 %2) %4 = mul i64 %0, %3 ret i64 %4 @@ -75,7 +67,7 @@ _llgo_3: ; preds = %_llgo_0 br i1 %5, label %_llgo_1, label %_llgo_2 } -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_string, align 8 %1 = icmp eq ptr %0, null @@ -96,7 +88,7 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -define linkonce i64 @"main.recur2[main.T]"(i64 %0) { +define linkonce i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.recur2[github.com/goplus/llgo/compiler/cl/_testgo/tprecur.T]"(i64 %0) { _llgo_0: %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.MakeSlice"(i64 %0, i64 %0, i64 8) %2 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, 1 @@ -145,7 +137,7 @@ _llgo_5: ; preds = %_llgo_4 _llgo_6: ; preds = %_llgo_4 %26 = sub i64 %0, 1 - %27 = call i64 @"main.recur1[main.T]"(i64 %26) + %27 = call i64 @"github.com/goplus/llgo/compiler/cl/_testgo/tprecur.recur1[github.com/goplus/llgo/compiler/cl/_testgo/tprecur.T]"(i64 %26) %28 = add i64 %14, %27 ret i64 %28 } diff --git a/compiler/cl/_testgo/tprecurfn/out.ll b/compiler/cl/_testgo/tprecurfn/out.ll index adafcf8e..0adc5233 100644 --- a/compiler/cl/_testgo/tprecurfn/out.ll +++ b/compiler/cl/_testgo/tprecurfn/out.ll @@ -1,61 +1,53 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn" -%"main.My[int]" = type { { ptr, ptr }, ptr } +%"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.My[int]" = type { { ptr, ptr }, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.My[int]", ptr %0, i32 0, i32 1 %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %3 = getelementptr inbounds %"main.My[int]", ptr %2, i32 0, i32 1 - %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %5 = getelementptr inbounds %"main.My[int]", ptr %4, i32 0, i32 0 - store { ptr, ptr } { ptr @"__llgo_stub.main.main$1", ptr null }, ptr %5, align 8 - store ptr %4, ptr %3, align 8 - %6 = getelementptr inbounds %"main.My[int]", ptr %2, i32 0, i32 1 - %7 = load ptr, ptr %6, align 8 - %8 = getelementptr inbounds %"main.My[int]", ptr %7, i32 0, i32 0 - %9 = load { ptr, ptr }, ptr %8, align 8 - %10 = extractvalue { ptr, ptr } %9, 1 - %11 = extractvalue { ptr, ptr } %9, 0 - call void %11(ptr %10, i64 100) - ret i32 0 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.My[int]", ptr %2, i32 0, i32 0 + store { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.main$1", ptr null }, ptr %3, align 8 + store ptr %2, ptr %1, align 8 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.My[int]", ptr %0, i32 0, i32 1 + %5 = load ptr, ptr %4, align 8 + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.My[int]", ptr %5, i32 0, i32 0 + %7 = load { ptr, ptr }, ptr %6, align 8 + %8 = extractvalue { ptr, ptr } %7, 1 + %9 = extractvalue { ptr, ptr } %7, 0 + call void %9(ptr %8, i64 100) + ret void } -define void @"main.main$1"(i64 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.main$1"(i64 %0) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define linkonce void @"__llgo_stub.main.main$1"(ptr %0, i64 %1) { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.main$1"(ptr %0, i64 %1) { _llgo_0: - tail call void @"main.main$1"(i64 %1) + tail call void @"github.com/goplus/llgo/compiler/cl/_testgo/tprecurfn.main$1"(i64 %1) ret void } diff --git a/compiler/cl/_testgo/tptypes/out.ll b/compiler/cl/_testgo/tptypes/out.ll index 69bb5529..d4d7fd1e 100644 --- a/compiler/cl/_testgo/tptypes/out.ll +++ b/compiler/cl/_testgo/tptypes/out.ll @@ -1,161 +1,153 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testgo/tptypes' +source_filename = "github.com/goplus/llgo/compiler/cl/_testgo/tptypes" -%"main.Data[int]" = type { i64 } -%"main.Data[string]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } +%"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[int]" = type { i64 } +%"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[string]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -%"main.Slice[[]int,int]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.Slice" } -%"main.Slice[[]string,string]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.Slice" } +%"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.Slice" } +%"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]string,string]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.Slice" } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [5 x i8] c"hello", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = alloca %"main.Data[int]", align 8 - call void @llvm.memset(ptr %2, i8 0, i64 8, i1 false) - %3 = getelementptr inbounds %"main.Data[int]", ptr %2, i32 0, i32 0 - store i64 1, ptr %3, align 4 - %4 = load %"main.Data[int]", ptr %2, align 4 - %5 = extractvalue %"main.Data[int]" %4, 0 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %5) + %0 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[int]", align 8 + call void @llvm.memset(ptr %0, i8 0, i64 8, i1 false) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[int]", ptr %0, i32 0, i32 0 + store i64 1, ptr %1, align 4 + %2 = load %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[int]", ptr %0, align 4 + %3 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[int]" %2, 0 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %3) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %6 = alloca %"main.Data[string]", align 8 - call void @llvm.memset(ptr %6, i8 0, i64 16, i1 false) - %7 = getelementptr inbounds %"main.Data[string]", ptr %6, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %7, align 8 - %8 = load %"main.Data[string]", ptr %6, align 8 - %9 = extractvalue %"main.Data[string]" %8, 0 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %9) + %4 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[string]", align 8 + call void @llvm.memset(ptr %4, i8 0, i64 16, i1 false) + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[string]", ptr %4, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %5, align 8 + %6 = load %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[string]", ptr %4, align 8 + %7 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[string]" %6, 0 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %7) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %10 = alloca %"main.Data[int]", align 8 - call void @llvm.memset(ptr %10, i8 0, i64 8, i1 false) - %11 = getelementptr inbounds %"main.Data[int]", ptr %10, i32 0, i32 0 - store i64 100, ptr %11, align 4 - %12 = load %"main.Data[int]", ptr %10, align 4 - %13 = extractvalue %"main.Data[int]" %12, 0 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %13) + %8 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[int]", align 8 + call void @llvm.memset(ptr %8, i8 0, i64 8, i1 false) + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[int]", ptr %8, i32 0, i32 0 + store i64 100, ptr %9, align 4 + %10 = load %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[int]", ptr %8, align 4 + %11 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[int]" %10, 0 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %11) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %14 = alloca %"main.Data[string]", align 8 - call void @llvm.memset(ptr %14, i8 0, i64 16, i1 false) - %15 = getelementptr inbounds %"main.Data[string]", ptr %14, i32 0, i32 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %15, align 8 - %16 = load %"main.Data[string]", ptr %14, align 8 - %17 = extractvalue %"main.Data[string]" %16, 0 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %17) + %12 = alloca %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[string]", align 8 + call void @llvm.memset(ptr %12, i8 0, i64 16, i1 false) + %13 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[string]", ptr %12, i32 0, i32 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %13, align 8 + %14 = load %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[string]", ptr %12, align 8 + %15 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Data[string]" %14, 0 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %15) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %18 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %20 = getelementptr inbounds i64, ptr %19, i64 0 - store i64 100, ptr %20, align 4 - %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %19, 0 - %22 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %21, i64 1, 1 - %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %22, i64 1, 2 - %24 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"main.(*Slice[[]int,int]).Append"(ptr %18, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %23) - %25 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %26 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %27 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %26, i64 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %27, align 8 - %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %26, 0 - %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28, i64 1, 1 - %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29, i64 1, 2 - %31 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"main.(*Slice[[]string,string]).Append"(ptr %25, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30) - %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %33 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %34 = getelementptr inbounds i64, ptr %33, i64 0 - store i64 1, ptr %34, align 4 - %35 = getelementptr inbounds i64, ptr %33, i64 1 - store i64 2, ptr %35, align 4 - %36 = getelementptr inbounds i64, ptr %33, i64 2 - store i64 3, ptr %36, align 4 - %37 = getelementptr inbounds i64, ptr %33, i64 3 - store i64 4, ptr %37, align 4 - %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %33, 0 - %39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38, i64 4, 1 - %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %39, i64 4, 2 - %41 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"main.(*Slice[[]int,int]).Append"(ptr %32, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40) - %42 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %43 = getelementptr inbounds i64, ptr %42, i64 0 - store i64 1, ptr %43, align 4 - %44 = getelementptr inbounds i64, ptr %42, i64 1 - store i64 2, ptr %44, align 4 - %45 = getelementptr inbounds i64, ptr %42, i64 2 - store i64 3, ptr %45, align 4 - %46 = getelementptr inbounds i64, ptr %42, i64 3 - store i64 4, ptr %46, align 4 - %47 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %42, 0 - %48 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %47, i64 4, 1 - %49 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %48, i64 4, 2 - %50 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"main.(*Slice[[]int,int]).Append2"(ptr %32, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %49) - %51 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %18, i32 0, i32 0 + %16 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) + %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + %18 = getelementptr inbounds i64, ptr %17, i64 0 + store i64 100, ptr %18, align 4 + %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %17, 0 + %20 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19, i64 1, 1 + %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %20, i64 1, 2 + %22 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.(*Slice[[]int,int]).Append"(ptr %16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %21) + %23 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) + %24 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + %25 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %24, i64 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %25, align 8 + %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %24, 0 + %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %26, i64 1, 1 + %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27, i64 1, 2 + %29 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.(*Slice[[]string,string]).Append"(ptr %23, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28) + %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) + %31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %32 = getelementptr inbounds i64, ptr %31, i64 0 + store i64 1, ptr %32, align 4 + %33 = getelementptr inbounds i64, ptr %31, i64 1 + store i64 2, ptr %33, align 4 + %34 = getelementptr inbounds i64, ptr %31, i64 2 + store i64 3, ptr %34, align 4 + %35 = getelementptr inbounds i64, ptr %31, i64 3 + store i64 4, ptr %35, align 4 + %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %31, 0 + %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36, i64 4, 1 + %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37, i64 4, 2 + %39 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.(*Slice[[]int,int]).Append"(ptr %30, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38) + %40 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %41 = getelementptr inbounds i64, ptr %40, i64 0 + store i64 1, ptr %41, align 4 + %42 = getelementptr inbounds i64, ptr %40, i64 1 + store i64 2, ptr %42, align 4 + %43 = getelementptr inbounds i64, ptr %40, i64 2 + store i64 3, ptr %43, align 4 + %44 = getelementptr inbounds i64, ptr %40, i64 3 + store i64 4, ptr %44, align 4 + %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %40, 0 + %46 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %45, i64 4, 1 + %47 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %46, i64 4, 2 + %48 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.(*Slice[[]int,int]).Append2"(ptr %30, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %47) + %49 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %16, i32 0, i32 0 + %50 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %49, align 8 + %51 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %16, i32 0, i32 0 %52 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %51, align 8 - %53 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %18, i32 0, i32 0 - %54 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %53, align 8 - %55 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %54, 0 - %56 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %54, 1 - %57 = icmp sge i64 0, %56 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %57) - %58 = getelementptr inbounds i64, ptr %55, i64 0 - %59 = load i64, ptr %58, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %52) + %53 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %52, 0 + %54 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %52, 1 + %55 = icmp sge i64 0, %54 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %55) + %56 = getelementptr inbounds i64, ptr %53, i64 0 + %57 = load i64, ptr %56, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %50) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %59) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %57) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %60 = getelementptr inbounds %"main.Slice[[]string,string]", ptr %25, i32 0, i32 0 + %58 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]string,string]", ptr %23, i32 0, i32 0 + %59 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %58, align 8 + %60 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]string,string]", ptr %23, i32 0, i32 0 %61 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %60, align 8 - %62 = getelementptr inbounds %"main.Slice[[]string,string]", ptr %25, i32 0, i32 0 - %63 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %62, align 8 - %64 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %63, 0 - %65 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %63, 1 - %66 = icmp sge i64 0, %65 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %66) - %67 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %64, i64 0 - %68 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %67, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61) + %62 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61, 0 + %63 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61, 1 + %64 = icmp sge i64 0, %63 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %64) + %65 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %62, i64 0 + %66 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %65, align 8 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %68) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %66) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %69 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %32, i32 0, i32 0 + %67 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %30, i32 0, i32 0 + %68 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %67, align 8 + %69 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %30, i32 0, i32 0 %70 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %69, align 8 - %71 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %32, i32 0, i32 0 - %72 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %71, align 8 - %73 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %72, 0 - %74 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %72, 1 - %75 = icmp sge i64 0, %74 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %75) - %76 = getelementptr inbounds i64, ptr %73, i64 0 - %77 = load i64, ptr %76, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %70) + %71 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %70, 0 + %72 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %70, 1 + %73 = icmp sge i64 0, %72 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %73) + %74 = getelementptr inbounds i64, ptr %71, i64 0 + %75 = load i64, ptr %74, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %77) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %75) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0 @@ -167,44 +159,44 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"gi declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"main.(*Slice[[]int,int]).Append"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { +define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.(*Slice[[]int,int]).Append"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { _llgo_0: - %2 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %0, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %2, align 8 %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, 0 %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, 1 %6 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.SliceAppend"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %3, ptr %4, i64 %5, i64 8) - %7 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %0, i32 0, i32 0 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %0, i32 0, i32 0 store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, ptr %7, align 8 - %8 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %0, i32 0, i32 0 + %8 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %0, i32 0, i32 0 %9 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %8, align 8 ret %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9 } -define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"main.(*Slice[[]string,string]).Append"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { +define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.(*Slice[[]string,string]).Append"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { _llgo_0: - %2 = getelementptr inbounds %"main.Slice[[]string,string]", ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]string,string]", ptr %0, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %2, align 8 %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, 0 %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, 1 %6 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.SliceAppend"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %3, ptr %4, i64 %5, i64 16) - %7 = getelementptr inbounds %"main.Slice[[]string,string]", ptr %0, i32 0, i32 0 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]string,string]", ptr %0, i32 0, i32 0 store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, ptr %7, align 8 - %8 = getelementptr inbounds %"main.Slice[[]string,string]", ptr %0, i32 0, i32 0 + %8 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]string,string]", ptr %0, i32 0, i32 0 %9 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %8, align 8 ret %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9 } -define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"main.(*Slice[[]int,int]).Append2"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { +define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.(*Slice[[]int,int]).Append2"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) { _llgo_0: - %2 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %0, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %2, align 8 %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, 0 %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, 1 %6 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.SliceAppend"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %3, ptr %4, i64 %5, i64 8) - %7 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %0, i32 0, i32 0 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %0, i32 0, i32 0 store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, ptr %7, align 8 - %8 = getelementptr inbounds %"main.Slice[[]int,int]", ptr %0, i32 0, i32 0 + %8 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testgo/tptypes.Slice[[]int,int]", ptr %0, i32 0, i32 0 %9 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %8, align 8 ret %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9 } diff --git a/compiler/cl/_testlibc/allocacstrs/out.ll b/compiler/cl/_testlibc/allocacstrs/out.ll index c61ab832..2c3f0567 100644 --- a/compiler/cl/_testlibc/allocacstrs/out.ll +++ b/compiler/cl/_testlibc/allocacstrs/out.ll @@ -1,97 +1,89 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [1 x i8] c"a", align 1 @1 = private unnamed_addr constant [1 x i8] c"b", align 1 @2 = private unnamed_addr constant [1 x i8] c"c", align 1 @3 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48) - %3 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, i64 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 1 }, ptr %3, align 8 - %4 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, i64 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, ptr %4, align 8 - %5 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, i64 2 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, ptr %5, align 8 - %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, i64 3, 1 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 3, 2 - %9 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, 1 - %10 = add i64 %9, 1 - %11 = alloca ptr, i64 %10, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48) + %1 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %0, i64 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 1 }, ptr %1, align 8 + %2 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %0, i64 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, ptr %2, align 8 + %3 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %0, i64 2 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, ptr %3, align 8 + %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %4, i64 3, 1 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %5, i64 3, 2 + %7 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, 1 + %8 = add i64 %7, 1 + %9 = alloca ptr, i64 %8, align 8 br label %_llgo_4 _llgo_1: ; preds = %_llgo_3, %_llgo_6 - %12 = phi i64 [ 0, %_llgo_6 ], [ %17, %_llgo_3 ] - %13 = getelementptr ptr, ptr %11, i64 %12 - %14 = load ptr, ptr %13, align 8 - %15 = icmp eq ptr %14, null - br i1 %15, label %_llgo_2, label %_llgo_3 + %10 = phi i64 [ 0, %_llgo_6 ], [ %15, %_llgo_3 ] + %11 = getelementptr ptr, ptr %9, i64 %10 + %12 = load ptr, ptr %11, align 8 + %13 = icmp eq ptr %12, null + br i1 %13, label %_llgo_2, label %_llgo_3 _llgo_2: ; preds = %_llgo_1 - ret i32 0 + ret void _llgo_3: ; preds = %_llgo_1 - %16 = call i32 (ptr, ...) @printf(ptr @3, ptr %14) - %17 = add i64 %12, 1 + %14 = call i32 (ptr, ...) @printf(ptr @3, ptr %12) + %15 = add i64 %10, 1 br label %_llgo_1 _llgo_4: ; preds = %_llgo_5, %_llgo_0 - %18 = phi i64 [ 0, %_llgo_0 ], [ %32, %_llgo_5 ] - %19 = icmp slt i64 %18, %9 - br i1 %19, label %_llgo_5, label %_llgo_6 + %16 = phi i64 [ 0, %_llgo_0 ], [ %30, %_llgo_5 ] + %17 = icmp slt i64 %16, %7 + br i1 %17, label %_llgo_5, label %_llgo_6 _llgo_5: ; preds = %_llgo_4 - %20 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, 0 - %21 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, 1 - %22 = icmp slt i64 %18, 0 - %23 = icmp sge i64 %18, %21 - %24 = or i1 %23, %22 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %24) - %25 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %20, i64 %18 - %26 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %25, align 8 - %27 = getelementptr ptr, ptr %11, i64 %18 - %28 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %26, 1 - %29 = add i64 %28, 1 - %30 = alloca i8, i64 %29, align 1 - %31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.CStrCopy"(ptr %30, %"github.com/goplus/llgo/runtime/internal/runtime.String" %26) - store ptr %31, ptr %27, align 8 - %32 = add i64 %18, 1 + %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, 0 + %19 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, 1 + %20 = icmp slt i64 %16, 0 + %21 = icmp sge i64 %16, %19 + %22 = or i1 %21, %20 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %22) + %23 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %18, i64 %16 + %24 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %23, align 8 + %25 = getelementptr ptr, ptr %9, i64 %16 + %26 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %24, 1 + %27 = add i64 %26, 1 + %28 = alloca i8, i64 %27, align 1 + %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.CStrCopy"(ptr %28, %"github.com/goplus/llgo/runtime/internal/runtime.String" %24) + store ptr %29, ptr %25, align 8 + %30 = add i64 %16, 1 br label %_llgo_4 _llgo_6: ; preds = %_llgo_4 - %33 = getelementptr ptr, ptr %11, i64 %9 - store ptr null, ptr %33, align 8 + %31 = getelementptr ptr, ptr %9, i64 %7 + store ptr null, ptr %31, align 8 br label %_llgo_1 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1) diff --git a/compiler/cl/_testlibc/argv/out.ll b/compiler/cl/_testlibc/argv/out.ll index 2bda712d..d21aa22e 100644 --- a/compiler/cl/_testlibc/argv/out.ll +++ b/compiler/cl/_testlibc/argv/out.ll @@ -1,50 +1,44 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/argv' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/argv" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibc/argv.init$guard" = global i1 false, align 1 +@__llgo_argc = external global i32, align 4 @0 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1 +@__llgo_argv = external global ptr, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/argv.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/argv.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/argv.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/argv.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() br label %_llgo_1 _llgo_1: ; preds = %_llgo_2, %_llgo_0 - %2 = phi i32 [ 0, %_llgo_0 ], [ %9, %_llgo_2 ] - %3 = load i32, ptr @__llgo_argc, align 4 - %4 = icmp slt i32 %2, %3 - br i1 %4, label %_llgo_2, label %_llgo_3 + %0 = phi i32 [ 0, %_llgo_0 ], [ %7, %_llgo_2 ] + %1 = load i32, ptr @__llgo_argc, align 4 + %2 = icmp slt i32 %0, %1 + br i1 %2, label %_llgo_2, label %_llgo_3 _llgo_2: ; preds = %_llgo_1 - %5 = load ptr, ptr @__llgo_argv, align 8 - %6 = getelementptr ptr, ptr %5, i32 %2 - %7 = load ptr, ptr %6, align 8 - %8 = call i32 (ptr, ...) @printf(ptr @0, ptr %7) - %9 = add i32 %2, 1 + %3 = load ptr, ptr @__llgo_argv, align 8 + %4 = getelementptr ptr, ptr %3, i32 %0 + %5 = load ptr, ptr %4, align 8 + %6 = call i32 (ptr, ...) @printf(ptr @0, ptr %5) + %7 = add i32 %0, 1 br label %_llgo_1 _llgo_3: ; preds = %_llgo_1 - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testlibc/atomic/out.ll b/compiler/cl/_testlibc/atomic/out.ll index 436b2cf5..052c4efd 100644 --- a/compiler/cl/_testlibc/atomic/out.ll +++ b/compiler/cl/_testlibc/atomic/out.ll @@ -1,59 +1,51 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/atomic' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/atomic" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [12 x i8] c"store: %ld\0A\00", align 1 @1 = private unnamed_addr constant [18 x i8] c"ret: %ld, v: %ld\0A\00", align 1 @2 = private unnamed_addr constant [25 x i8] c"ret: %ld vs 100, v: %ld\0A\00", align 1 @3 = private unnamed_addr constant [25 x i8] c"ret: %ld vs 101, v: %ld\0A\00", align 1 @4 = private unnamed_addr constant [18 x i8] c"ret: %ld, v: %ld\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - store atomic i64 100, ptr %2 seq_cst, align 4 - %3 = load atomic i64, ptr %2 seq_cst, align 4 - %4 = call i32 (ptr, ...) @printf(ptr @0, i64 %3) - %5 = atomicrmw add ptr %2, i64 1 seq_cst, align 8 - %6 = load i64, ptr %2, align 4 - %7 = call i32 (ptr, ...) @printf(ptr @1, i64 %5, i64 %6) - %8 = cmpxchg ptr %2, i64 100, i64 102 seq_cst seq_cst, align 8 - %9 = extractvalue { i64, i1 } %8, 0 - %10 = extractvalue { i64, i1 } %8, 1 - %11 = load i64, ptr %2, align 4 - %12 = call i32 (ptr, ...) @printf(ptr @2, i64 %9, i64 %11) - %13 = cmpxchg ptr %2, i64 101, i64 102 seq_cst seq_cst, align 8 - %14 = extractvalue { i64, i1 } %13, 0 - %15 = extractvalue { i64, i1 } %13, 1 - %16 = load i64, ptr %2, align 4 - %17 = call i32 (ptr, ...) @printf(ptr @3, i64 %14, i64 %16) - %18 = atomicrmw sub ptr %2, i64 1 seq_cst, align 8 - %19 = load i64, ptr %2, align 4 - %20 = call i32 (ptr, ...) @printf(ptr @4, i64 %18, i64 %19) - ret i32 0 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + store atomic i64 100, ptr %0 seq_cst, align 4 + %1 = load atomic i64, ptr %0 seq_cst, align 4 + %2 = call i32 (ptr, ...) @printf(ptr @0, i64 %1) + %3 = atomicrmw add ptr %0, i64 1 seq_cst, align 8 + %4 = load i64, ptr %0, align 4 + %5 = call i32 (ptr, ...) @printf(ptr @1, i64 %3, i64 %4) + %6 = cmpxchg ptr %0, i64 100, i64 102 seq_cst seq_cst, align 8 + %7 = extractvalue { i64, i1 } %6, 0 + %8 = extractvalue { i64, i1 } %6, 1 + %9 = load i64, ptr %0, align 4 + %10 = call i32 (ptr, ...) @printf(ptr @2, i64 %7, i64 %9) + %11 = cmpxchg ptr %0, i64 101, i64 102 seq_cst seq_cst, align 8 + %12 = extractvalue { i64, i1 } %11, 0 + %13 = extractvalue { i64, i1 } %11, 1 + %14 = load i64, ptr %0, align 4 + %15 = call i32 (ptr, ...) @printf(ptr @3, i64 %12, i64 %14) + %16 = atomicrmw sub ptr %0, i64 1 seq_cst, align 8 + %17 = load i64, ptr %0, align 4 + %18 = call i32 (ptr, ...) @printf(ptr @4, i64 %16, i64 %17) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testlibc/complex/out.ll b/compiler/cl/_testlibc/complex/out.ll index 177fcf1e..0f4a21f9 100644 --- a/compiler/cl/_testlibc/complex/out.ll +++ b/compiler/cl/_testlibc/complex/out.ll @@ -1,17 +1,15 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/complex' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/complex" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testlibc/complex.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [5 x i8] c"addr:", align 1 @1 = private unnamed_addr constant [10 x i8] c"abs(3+4i):", align 1 @2 = private unnamed_addr constant [11 x i8] c"real(3+4i):", align 1 @3 = private unnamed_addr constant [11 x i8] c"imag(3+4i):", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -define void @main.f({ float, float } %0, { float, float } %1, ptr %2) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.f"({ float, float } %0, { float, float } %1, ptr %2) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -38,27 +36,23 @@ _llgo_0: ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.f({ float, float } { float 3.000000e+00, float 4.000000e+00 }, { float, float } { float 3.000000e+00, float 4.000000e+00 }, ptr @main.f) - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.f"({ float, float } { float 3.000000e+00, float 4.000000e+00 }, { float, float } { float 3.000000e+00, float 4.000000e+00 }, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.f") + ret void } declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String") @@ -70,5 +64,3 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr declare float @cabsf({ float, float }) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double) - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testlibc/demangle/out.ll b/compiler/cl/_testlibc/demangle/out.ll index 9cd62d7b..b7ab929e 100644 --- a/compiler/cl/_testlibc/demangle/out.ll +++ b/compiler/cl/_testlibc/demangle/out.ll @@ -1,44 +1,38 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/demangle' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/demangle" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [29 x i8] c"__ZNK9INIReader10ParseErrorEv", align 1 @1 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1 @2 = private unnamed_addr constant [18 x i8] c"Failed to demangle", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @_ZN4llvm15itaniumDemangleENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEb(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 29 }, i1 true) - %3 = icmp ne ptr %2, null - br i1 %3, label %_llgo_1, label %_llgo_3 + %0 = call ptr @_ZN4llvm15itaniumDemangleENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEb(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 29 }, i1 true) + %1 = icmp ne ptr %0, null + br i1 %1, label %_llgo_1, label %_llgo_3 _llgo_1: ; preds = %_llgo_0 - %4 = call i32 (ptr, ...) @printf(ptr @1, ptr %2) + %2 = call i32 (ptr, ...) @printf(ptr @1, ptr %0) br label %_llgo_2 _llgo_2: ; preds = %_llgo_3, %_llgo_1 - ret i32 0 + ret void _llgo_3: ; preds = %_llgo_0 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 18 }) @@ -46,8 +40,6 @@ _llgo_3: ; preds = %_llgo_0 br label %_llgo_2 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @_ZN4llvm15itaniumDemangleENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEb(%"github.com/goplus/llgo/runtime/internal/runtime.String", i1) declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testlibc/sqlite/out.ll b/compiler/cl/_testlibc/sqlite/out.ll index bd535eee..8adfd6a7 100644 --- a/compiler/cl/_testlibc/sqlite/out.ll +++ b/compiler/cl/_testlibc/sqlite/out.ll @@ -1,13 +1,11 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/sqlite' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/sqlite" -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [20 x i8] c"==> Error: (%d) %s\0A\00", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @1 = private unnamed_addr constant [9 x i8] c":memory:\00", align 1 -define void @main.check(i32 %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.check"(i32 %0) { _llgo_0: %1 = icmp ne i32 %0, 0 br i1 %1, label %_llgo_1, label %_llgo_2 @@ -22,31 +20,27 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call { ptr, i32 } @"github.com/goplus/llgo/c/sqlite.OpenV2"(ptr @1, i32 130, ptr null) - %3 = extractvalue { ptr, i32 } %2, 0 - %4 = extractvalue { ptr, i32 } %2, 1 - call void @main.check(i32 %4) - %5 = call i32 @sqlite3_close(ptr %3) - ret i32 0 + %0 = call { ptr, i32 } @"github.com/goplus/llgo/c/sqlite.OpenV2"(ptr @1, i32 130, ptr null) + %1 = extractvalue { ptr, i32 } %0, 0 + %2 = extractvalue { ptr, i32 } %0, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.check"(i32 %2) + %3 = call i32 @sqlite3_close(ptr %1) + ret void } declare ptr @sqlite3_errstr(i32) @@ -55,8 +49,6 @@ declare i32 @printf(ptr, ...) declare void @exit(i32) -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare { ptr, i32 } @"github.com/goplus/llgo/c/sqlite.OpenV2"(ptr, i32, ptr) declare i32 @sqlite3_close(ptr) diff --git a/compiler/cl/_testlibgo/atomic/out.ll b/compiler/cl/_testlibgo/atomic/out.ll index 682cd4f0..ab3d3d8e 100644 --- a/compiler/cl/_testlibgo/atomic/out.ll +++ b/compiler/cl/_testlibgo/atomic/out.ll @@ -1,23 +1,21 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibgo/atomic' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibgo/atomic" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibgo/atomic.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [6 x i8] c"store:", align 1 @1 = private unnamed_addr constant [4 x i8] c"ret:", align 1 @2 = private unnamed_addr constant [2 x i8] c"v:", align 1 @3 = private unnamed_addr constant [4 x i8] c"swp:", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/atomic.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/atomic.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/atomic.init$guard", align 1 call void @"sync/atomic.init"() br label %_llgo_2 @@ -25,31 +23,37 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/atomic.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - store atomic i64 100, ptr %2 seq_cst, align 4 - %3 = load atomic i64, ptr %2 seq_cst, align 4 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + store atomic i64 100, ptr %0 seq_cst, align 4 + %1 = load atomic i64, ptr %0 seq_cst, align 4 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 6 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %1) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) + %2 = call i64 @"sync/atomic.AddInt64"(ptr %0, i64 1) + %3 = load i64, ptr %0, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %2) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 2 }) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %3) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %4 = call i64 @"sync/atomic.AddInt64"(ptr %2, i64 1) - %5 = load i64, ptr %2, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }) + %4 = call i1 @"sync/atomic.CompareAndSwapInt64"(ptr %0, i64 100, i64 102) + %5 = load i64, ptr %0, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %4) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %4) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 2 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %5) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %6 = call i1 @"sync/atomic.CompareAndSwapInt64"(ptr %2, i64 100, i64 102) - %7 = load i64, ptr %2, align 4 + %6 = call i1 @"sync/atomic.CompareAndSwapInt64"(ptr %0, i64 101, i64 102) + %7 = load i64, ptr %0, align 4 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %6) @@ -58,33 +62,21 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %7) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %8 = call i1 @"sync/atomic.CompareAndSwapInt64"(ptr %2, i64 101, i64 102) - %9 = load i64, ptr %2, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }) + %8 = call i64 @"sync/atomic.AddInt64"(ptr %0, i64 -1) + %9 = load i64, ptr %0, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %8) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %8) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 2 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %9) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %10 = call i64 @"sync/atomic.AddInt64"(ptr %2, i64 -1) - %11 = load i64, ptr %2, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %10) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 2 }) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %11) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare void @"sync/atomic.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String") diff --git a/compiler/cl/_testlibgo/bytes/out.ll b/compiler/cl/_testlibgo/bytes/out.ll index 4dd5b018..858564ee 100644 --- a/compiler/cl/_testlibgo/bytes/out.ll +++ b/compiler/cl/_testlibgo/bytes/out.ll @@ -1,26 +1,24 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibgo/bytes' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibgo/bytes" %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibgo/bytes.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [6 x i8] c"Hello ", align 1 @1 = private unnamed_addr constant [5 x i8] c"World", align 1 @2 = private unnamed_addr constant [3 x i8] c"buf", align 1 @3 = private unnamed_addr constant [2 x i8] c"Go", align 1 @4 = private unnamed_addr constant [2 x i8] c"go", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/bytes.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/bytes.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/bytes.init$guard", align 1 call void @bytes.init() br label %_llgo_2 @@ -28,36 +26,30 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/bytes.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) - %3 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 6 }) - %4 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"bytes.(*Buffer).Write"(ptr %2, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %3) - %5 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"bytes.(*Buffer).WriteString"(ptr %2, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }) - %6 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"bytes.(*Buffer).Bytes"(ptr %2) - %7 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"bytes.(*Buffer).String"(ptr %2) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) + %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 6 }) + %2 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"bytes.(*Buffer).Write"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) + %3 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"bytes.(*Buffer).WriteString"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }) + %4 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"bytes.(*Buffer).Bytes"(ptr %0) + %5 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"bytes.(*Buffer).String"(ptr %0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 3 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %4) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %7) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %5) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %8 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 2 }) - %9 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 2 }) - %10 = call i1 @bytes.EqualFold(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %10) + %6 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 2 }) + %7 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 2 }) + %8 = call i1 @bytes.EqualFold(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %8) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare void @bytes.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String") diff --git a/compiler/cl/_testlibgo/complex/out.ll b/compiler/cl/_testlibgo/complex/out.ll index e25e563d..c42614d7 100644 --- a/compiler/cl/_testlibgo/complex/out.ll +++ b/compiler/cl/_testlibgo/complex/out.ll @@ -1,16 +1,14 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibgo/complex' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibgo/complex" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testlibgo/complex.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [10 x i8] c"abs(3+4i):", align 1 @1 = private unnamed_addr constant [11 x i8] c"real(3+4i):", align 1 @2 = private unnamed_addr constant [11 x i8] c"imag(3+4i):", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -define void @main.f({ double, double } %0, { double, double } %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/complex.f"({ double, double } %0, { double, double } %1) { _llgo_0: %2 = call double @cabs({ double, double } %0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 10 }) @@ -30,13 +28,13 @@ _llgo_0: ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/complex.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/complex.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/complex.init$guard", align 1 call void @"math/cmplx.init"() br label %_llgo_2 @@ -44,14 +42,10 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/complex.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.f({ double, double } { double 3.000000e+00, double 4.000000e+00 }, { double, double } { double 3.000000e+00, double 4.000000e+00 }) - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testlibgo/complex.f"({ double, double } { double 3.000000e+00, double 4.000000e+00 }, { double, double } { double 3.000000e+00, double 4.000000e+00 }) + ret void } declare double @cabs({ double, double }) @@ -63,5 +57,3 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double) declare void @"math/cmplx.init"() - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testlibgo/errors/out.ll b/compiler/cl/_testlibgo/errors/out.ll index 39cbd43e..c7d9ca03 100644 --- a/compiler/cl/_testlibgo/errors/out.ll +++ b/compiler/cl/_testlibgo/errors/out.ll @@ -1,22 +1,20 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibgo/errors' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibgo/errors" %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibgo/errors.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [5 x i8] c"error", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/errors.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/errors.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/errors.init$guard", align 1 call void @errors.init() br label %_llgo_2 @@ -24,25 +22,19 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/errors.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @errors.New(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }) - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %2) - %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2, 1 - %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0 - %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr %4, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %6) + %0 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @errors.New(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }) + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) + %2 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, 1 + %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %1, 0 + %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, ptr %2, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %4) unreachable } declare void @errors.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare %"github.com/goplus/llgo/runtime/internal/runtime.iface" @errors.New(%"github.com/goplus/llgo/runtime/internal/runtime.String") declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface") diff --git a/compiler/cl/_testlibgo/math/out.ll b/compiler/cl/_testlibgo/math/out.ll index 500ae362..969d206e 100644 --- a/compiler/cl/_testlibgo/math/out.ll +++ b/compiler/cl/_testlibgo/math/out.ll @@ -1,17 +1,15 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibgo/math' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibgo/math" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibgo/math.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/math.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/math.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/math.init$guard", align 1 call void @math.init() br label %_llgo_2 @@ -19,28 +17,22 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/math.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call double @sqrt(double 2.000000e+00) + %0 = call double @sqrt(double 2.000000e+00) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %0) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) + %1 = call double @math.Abs(double -1.200000e+00) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %1) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) + %2 = call double @math.Ldexp(double 1.200000e+00, i64 3) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %2) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %3 = call double @math.Abs(double -1.200000e+00) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %3) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %4 = call double @math.Ldexp(double 1.200000e+00, i64 3) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %4) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare void @math.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare double @sqrt(double) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double) diff --git a/compiler/cl/_testlibgo/mathbits/out.ll b/compiler/cl/_testlibgo/mathbits/out.ll index 843caec6..46fcdaa7 100644 --- a/compiler/cl/_testlibgo/mathbits/out.ll +++ b/compiler/cl/_testlibgo/mathbits/out.ll @@ -1,17 +1,15 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibgo/mathbits' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibgo/mathbits" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibgo/mathbits.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/mathbits.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/mathbits.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/mathbits.init$guard", align 1 call void @"math/bits.init"() br label %_llgo_2 @@ -19,25 +17,19 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/mathbits.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call i64 @"math/bits.Len8"(i8 20) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %2) + %0 = call i64 @"math/bits.Len8"(i8 20) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %3 = call i64 @"math/bits.OnesCount"(i64 20) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %3) + %1 = call i64 @"math/bits.OnesCount"(i64 20) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %1) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare void @"math/bits.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i64 @"math/bits.Len8"(i8) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) diff --git a/compiler/cl/_testlibgo/nettextproto/out.ll b/compiler/cl/_testlibgo/nettextproto/out.ll index bee86d3d..06d3f994 100644 --- a/compiler/cl/_testlibgo/nettextproto/out.ll +++ b/compiler/cl/_testlibgo/nettextproto/out.ll @@ -1,20 +1,18 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibgo/nettextproto' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibgo/nettextproto" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibgo/nettextproto.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [4 x i8] c"host", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/nettextproto.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/nettextproto.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/nettextproto.init$guard", align 1 call void @"net/textproto.init"() br label %_llgo_2 @@ -22,22 +20,16 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/nettextproto.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"net/textproto.CanonicalMIMEHeaderKey"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %2) + %0 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"net/textproto.CanonicalMIMEHeaderKey"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare void @"net/textproto.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare %"github.com/goplus/llgo/runtime/internal/runtime.String" @"net/textproto.CanonicalMIMEHeaderKey"(%"github.com/goplus/llgo/runtime/internal/runtime.String") declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String") diff --git a/compiler/cl/_testlibgo/os/out.ll b/compiler/cl/_testlibgo/os/out.ll index 98c3a820..ce16f79c 100644 --- a/compiler/cl/_testlibgo/os/out.ll +++ b/compiler/cl/_testlibgo/os/out.ll @@ -1,22 +1,20 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibgo/os' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibgo/os" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibgo/os.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [4 x i8] c"cwd:", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/os.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/os.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/os.init$guard", align 1 call void @os.init() br label %_llgo_2 @@ -24,46 +22,40 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/os.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call { %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @os.Getwd() - %3 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %2, 0 - %4 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %2, 1 - %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %4) - %6 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %4, 1 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %5, 0 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr %6, 1 - %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) - %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %9, 0 - %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, ptr null, 1 - %12 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %11) - %13 = xor i1 %12, true - br i1 %13, label %_llgo_1, label %_llgo_2 + %0 = call { %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @os.Getwd() + %1 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %0, 0 + %2 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } %0, 1 + %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %2) + %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2, 1 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr %4, 1 + %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) + %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %7, 0 + %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, ptr null, 1 + %10 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9) + %11 = xor i1 %10, true + br i1 %11, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %4) - %15 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %4, 1 - %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %14, 0 - %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %16, ptr %15, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %17) + %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %2) + %13 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2, 1 + %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %12, 0 + %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %14, ptr %13, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %15) unreachable _llgo_2: ; preds = %_llgo_0 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %3) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %1) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare void @os.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare { %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @os.Getwd() declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface", %"github.com/goplus/llgo/runtime/internal/runtime.eface") diff --git a/compiler/cl/_testlibgo/strings/out.ll b/compiler/cl/_testlibgo/strings/out.ll index eb1f1494..62c15564 100644 --- a/compiler/cl/_testlibgo/strings/out.ll +++ b/compiler/cl/_testlibgo/strings/out.ll @@ -1,13 +1,11 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibgo/strings' +source_filename = "github.com/goplus/llgo/compiler/cl/_testlibgo/strings" %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testlibgo/strings.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [6 x i8] c"Hello ", align 1 @1 = private unnamed_addr constant [5 x i8] c"World", align 1 @2 = private unnamed_addr constant [4 x i8] c"len:", align 1 @@ -17,13 +15,13 @@ source_filename = "main" @6 = private unnamed_addr constant [12 x i8] c"Hello, world", align 1 @unicode.Han = external global ptr, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/strings.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/strings.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibgo/strings.init$guard", align 1 call void @strings.init() call void @unicode.init() br label %_llgo_2 @@ -32,41 +30,37 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testlibgo/strings.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %3 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 6 }) - %4 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"strings.(*Builder).Write"(ptr %2, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %3) - %5 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"strings.(*Builder).WriteString"(ptr %2, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }) - %6 = call i64 @"strings.(*Builder).Len"(ptr %2) - %7 = call i64 @"strings.(*Builder).Cap"(ptr %2) - %8 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"strings.(*Builder).String"(ptr %2) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 6 }) + %2 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"strings.(*Builder).Write"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1) + %3 = call { i64, %"github.com/goplus/llgo/runtime/internal/runtime.iface" } @"strings.(*Builder).WriteString"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }) + %4 = call i64 @"strings.(*Builder).Len"(ptr %0) + %5 = call i64 @"strings.(*Builder).Cap"(ptr %0) + %6 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"strings.(*Builder).String"(ptr %0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %6) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %4) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %7) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %5) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 7 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %8) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %6) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %9 = call i64 @strings.IndexFunc(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 13 }, { ptr, ptr } { ptr @"__llgo_stub.main.main$1", ptr null }) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %9) + %7 = call i64 @strings.IndexFunc(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 13 }, { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testlibgo/strings.main$1", ptr null }) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %7) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %10 = call i64 @strings.IndexFunc(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 12 }, { ptr, ptr } { ptr @"__llgo_stub.main.main$1", ptr null }) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %10) + %8 = call i64 @strings.IndexFunc(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 12 }, { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testlibgo/strings.main$1", ptr null }) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %8) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -define i1 @"main.main$1"(i32 %0) { +define i1 @"github.com/goplus/llgo/compiler/cl/_testlibgo/strings.main$1"(i32 %0) { _llgo_0: %1 = load ptr, ptr @unicode.Han, align 8 %2 = call i1 @unicode.Is(ptr %1, i32 %0) @@ -77,8 +71,6 @@ declare void @strings.init() declare void @unicode.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String") @@ -101,9 +93,9 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) declare i64 @strings.IndexFunc(%"github.com/goplus/llgo/runtime/internal/runtime.String", { ptr, ptr }) -define linkonce i1 @"__llgo_stub.main.main$1"(ptr %0, i32 %1) { +define linkonce i1 @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testlibgo/strings.main$1"(ptr %0, i32 %1) { _llgo_0: - %2 = tail call i1 @"main.main$1"(i32 %1) + %2 = tail call i1 @"github.com/goplus/llgo/compiler/cl/_testlibgo/strings.main$1"(i32 %1) ret i1 %2 } diff --git a/compiler/cl/_testpy/callpy/out.ll b/compiler/cl/_testpy/callpy/out.ll index be2ec827..6771430e 100644 --- a/compiler/cl/_testpy/callpy/out.ll +++ b/compiler/cl/_testpy/callpy/out.ll @@ -1,9 +1,7 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testpy/callpy' +source_filename = "github.com/goplus/llgo/compiler/cl/_testpy/callpy" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testpy/callpy.init$guard" = global i1 false, align 1 @__llgo_py.math.sqrt = linkonce global ptr null, align 8 @__llgo_py.os.getcwd = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [14 x i8] c"sqrt(2) = %f\0A\00", align 1 @@ -16,13 +14,13 @@ source_filename = "main" @__llgo_py.os = external global ptr, align 8 @4 = private unnamed_addr constant [7 x i8] c"getcwd\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/callpy.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/callpy.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/callpy.init$guard", align 1 call void @"github.com/goplus/llgo/py/math.init"() call void @"github.com/goplus/llgo/py/os.init"() call void @"github.com/goplus/llgo/py/std.init"() @@ -38,23 +36,19 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/callpy.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @PyFloat_FromDouble(double 2.000000e+00) - %3 = load ptr, ptr @__llgo_py.math.sqrt, align 8 - %4 = call ptr @PyObject_CallOneArg(ptr %3, ptr %2) - %5 = load ptr, ptr @__llgo_py.os.getcwd, align 8 - %6 = call ptr @PyObject_CallNoArgs(ptr %5) - %7 = call double @PyFloat_AsDouble(ptr %4) - %8 = call i32 (ptr, ...) @printf(ptr @0, double %7) - %9 = call ptr @PyUnicode_FromString(ptr @1) - %10 = load ptr, ptr @__llgo_py.builtins.print, align 8 - %11 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %10, ptr %9, ptr %6, ptr null) - ret i32 0 + %0 = call ptr @PyFloat_FromDouble(double 2.000000e+00) + %1 = load ptr, ptr @__llgo_py.math.sqrt, align 8 + %2 = call ptr @PyObject_CallOneArg(ptr %1, ptr %0) + %3 = load ptr, ptr @__llgo_py.os.getcwd, align 8 + %4 = call ptr @PyObject_CallNoArgs(ptr %3) + %5 = call double @PyFloat_AsDouble(ptr %2) + %6 = call i32 (ptr, ...) @printf(ptr @0, double %5) + %7 = call ptr @PyUnicode_FromString(ptr @1) + %8 = load ptr, ptr @__llgo_py.builtins.print, align 8 + %9 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %8, ptr %7, ptr %4, ptr null) + ret void } declare void @"github.com/goplus/llgo/py/math.init"() @@ -63,8 +57,6 @@ declare void @"github.com/goplus/llgo/py/os.init"() declare void @"github.com/goplus/llgo/py/std.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @PyFloat_FromDouble(double) declare ptr @PyObject_CallOneArg(ptr, ptr) diff --git a/compiler/cl/_testpy/gcd/out.ll b/compiler/cl/_testpy/gcd/out.ll index 34a2000b..a2c49780 100644 --- a/compiler/cl/_testpy/gcd/out.ll +++ b/compiler/cl/_testpy/gcd/out.ll @@ -1,21 +1,19 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testpy/gcd' +source_filename = "github.com/goplus/llgo/compiler/cl/_testpy/gcd" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testpy/gcd.init$guard" = global i1 false, align 1 @__llgo_py.math.gcd = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [22 x i8] c"gcd(60, 20, 25) = %d\0A\00", align 1 @__llgo_py.math = external global ptr, align 8 @1 = private unnamed_addr constant [4 x i8] c"gcd\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/gcd.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/gcd.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/gcd.init$guard", align 1 call void @"github.com/goplus/llgo/py/math.init"() %1 = load ptr, ptr @__llgo_py.math, align 8 call void (ptr, ...) @llgoLoadPyModSyms(ptr %1, ptr @1, ptr @__llgo_py.math.gcd, ptr null) @@ -25,26 +23,20 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/gcd.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @PyLong_FromLong(i64 60) - %3 = call ptr @PyLong_FromLong(i64 20) - %4 = call ptr @PyLong_FromLong(i64 25) - %5 = load ptr, ptr @__llgo_py.math.gcd, align 8 - %6 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %5, ptr %2, ptr %3, ptr %4, ptr null) - %7 = call i64 @PyLong_AsLong(ptr %6) - %8 = call i32 (ptr, ...) @printf(ptr @0, i64 %7) - ret i32 0 + %0 = call ptr @PyLong_FromLong(i64 60) + %1 = call ptr @PyLong_FromLong(i64 20) + %2 = call ptr @PyLong_FromLong(i64 25) + %3 = load ptr, ptr @__llgo_py.math.gcd, align 8 + %4 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %3, ptr %0, ptr %1, ptr %2, ptr null) + %5 = call i64 @PyLong_AsLong(ptr %4) + %6 = call i32 (ptr, ...) @printf(ptr @0, i64 %5) + ret void } declare void @"github.com/goplus/llgo/py/math.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @PyLong_FromLong(i64) declare ptr @PyObject_CallFunctionObjArgs(ptr, ...) diff --git a/compiler/cl/_testpy/matrix/out.ll b/compiler/cl/_testpy/matrix/out.ll index 95050021..6b228d2d 100644 --- a/compiler/cl/_testpy/matrix/out.ll +++ b/compiler/cl/_testpy/matrix/out.ll @@ -1,9 +1,7 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testpy/matrix' +source_filename = "github.com/goplus/llgo/compiler/cl/_testpy/matrix" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testpy/matrix.init$guard" = global i1 false, align 1 @__llgo_py.numpy.add = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [8 x i8] c"a = %s\0A\00", align 1 @1 = private unnamed_addr constant [8 x i8] c"a = %s\0A\00", align 1 @@ -11,13 +9,13 @@ source_filename = "main" @__llgo_py.numpy = external global ptr, align 8 @3 = private unnamed_addr constant [4 x i8] c"add\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/matrix.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/matrix.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/matrix.init$guard", align 1 call void @"github.com/goplus/llgo/py/numpy.init"() %1 = load ptr, ptr @__llgo_py.numpy, align 8 call void (ptr, ...) @llgoLoadPyModSyms(ptr %1, ptr @3, ptr @__llgo_py.numpy.add, ptr null) @@ -27,80 +25,74 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/matrix.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @PyList_New(i64 3) - %3 = call ptr @PyFloat_FromDouble(double 1.000000e+00) - %4 = call i32 @PyList_SetItem(ptr %2, i64 0, ptr %3) - %5 = call ptr @PyFloat_FromDouble(double 2.000000e+00) - %6 = call i32 @PyList_SetItem(ptr %2, i64 1, ptr %5) - %7 = call ptr @PyFloat_FromDouble(double 3.000000e+00) - %8 = call i32 @PyList_SetItem(ptr %2, i64 2, ptr %7) - %9 = call ptr @PyList_New(i64 3) - %10 = call ptr @PyFloat_FromDouble(double 4.000000e+00) - %11 = call i32 @PyList_SetItem(ptr %9, i64 0, ptr %10) - %12 = call ptr @PyFloat_FromDouble(double 5.000000e+00) - %13 = call i32 @PyList_SetItem(ptr %9, i64 1, ptr %12) - %14 = call ptr @PyFloat_FromDouble(double 6.000000e+00) - %15 = call i32 @PyList_SetItem(ptr %9, i64 2, ptr %14) - %16 = call ptr @PyList_New(i64 3) - %17 = call ptr @PyFloat_FromDouble(double 7.000000e+00) - %18 = call i32 @PyList_SetItem(ptr %16, i64 0, ptr %17) - %19 = call ptr @PyFloat_FromDouble(double 8.000000e+00) - %20 = call i32 @PyList_SetItem(ptr %16, i64 1, ptr %19) - %21 = call ptr @PyFloat_FromDouble(double 9.000000e+00) - %22 = call i32 @PyList_SetItem(ptr %16, i64 2, ptr %21) - %23 = call ptr @PyList_New(i64 3) - %24 = call i32 @PyList_SetItem(ptr %23, i64 0, ptr %2) - %25 = call i32 @PyList_SetItem(ptr %23, i64 1, ptr %9) - %26 = call i32 @PyList_SetItem(ptr %23, i64 2, ptr %16) - %27 = call ptr @PyList_New(i64 3) - %28 = call ptr @PyFloat_FromDouble(double 9.000000e+00) - %29 = call i32 @PyList_SetItem(ptr %27, i64 0, ptr %28) - %30 = call ptr @PyFloat_FromDouble(double 8.000000e+00) - %31 = call i32 @PyList_SetItem(ptr %27, i64 1, ptr %30) - %32 = call ptr @PyFloat_FromDouble(double 7.000000e+00) - %33 = call i32 @PyList_SetItem(ptr %27, i64 2, ptr %32) - %34 = call ptr @PyList_New(i64 3) - %35 = call ptr @PyFloat_FromDouble(double 6.000000e+00) - %36 = call i32 @PyList_SetItem(ptr %34, i64 0, ptr %35) - %37 = call ptr @PyFloat_FromDouble(double 5.000000e+00) - %38 = call i32 @PyList_SetItem(ptr %34, i64 1, ptr %37) - %39 = call ptr @PyFloat_FromDouble(double 4.000000e+00) - %40 = call i32 @PyList_SetItem(ptr %34, i64 2, ptr %39) - %41 = call ptr @PyList_New(i64 3) - %42 = call ptr @PyFloat_FromDouble(double 3.000000e+00) - %43 = call i32 @PyList_SetItem(ptr %41, i64 0, ptr %42) - %44 = call ptr @PyFloat_FromDouble(double 2.000000e+00) - %45 = call i32 @PyList_SetItem(ptr %41, i64 1, ptr %44) - %46 = call ptr @PyFloat_FromDouble(double 1.000000e+00) - %47 = call i32 @PyList_SetItem(ptr %41, i64 2, ptr %46) - %48 = call ptr @PyList_New(i64 3) - %49 = call i32 @PyList_SetItem(ptr %48, i64 0, ptr %27) - %50 = call i32 @PyList_SetItem(ptr %48, i64 1, ptr %34) - %51 = call i32 @PyList_SetItem(ptr %48, i64 2, ptr %41) - %52 = load ptr, ptr @__llgo_py.numpy.add, align 8 - %53 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %52, ptr %23, ptr %48, ptr null) - %54 = call ptr @PyObject_Str(ptr %23) - %55 = call ptr @PyUnicode_AsUTF8(ptr %54) - %56 = call i32 (ptr, ...) @printf(ptr @0, ptr %55) - %57 = call ptr @PyObject_Str(ptr %48) - %58 = call ptr @PyUnicode_AsUTF8(ptr %57) - %59 = call i32 (ptr, ...) @printf(ptr @1, ptr %58) - %60 = call ptr @PyObject_Str(ptr %53) - %61 = call ptr @PyUnicode_AsUTF8(ptr %60) - %62 = call i32 (ptr, ...) @printf(ptr @2, ptr %61) - ret i32 0 + %0 = call ptr @PyList_New(i64 3) + %1 = call ptr @PyFloat_FromDouble(double 1.000000e+00) + %2 = call i32 @PyList_SetItem(ptr %0, i64 0, ptr %1) + %3 = call ptr @PyFloat_FromDouble(double 2.000000e+00) + %4 = call i32 @PyList_SetItem(ptr %0, i64 1, ptr %3) + %5 = call ptr @PyFloat_FromDouble(double 3.000000e+00) + %6 = call i32 @PyList_SetItem(ptr %0, i64 2, ptr %5) + %7 = call ptr @PyList_New(i64 3) + %8 = call ptr @PyFloat_FromDouble(double 4.000000e+00) + %9 = call i32 @PyList_SetItem(ptr %7, i64 0, ptr %8) + %10 = call ptr @PyFloat_FromDouble(double 5.000000e+00) + %11 = call i32 @PyList_SetItem(ptr %7, i64 1, ptr %10) + %12 = call ptr @PyFloat_FromDouble(double 6.000000e+00) + %13 = call i32 @PyList_SetItem(ptr %7, i64 2, ptr %12) + %14 = call ptr @PyList_New(i64 3) + %15 = call ptr @PyFloat_FromDouble(double 7.000000e+00) + %16 = call i32 @PyList_SetItem(ptr %14, i64 0, ptr %15) + %17 = call ptr @PyFloat_FromDouble(double 8.000000e+00) + %18 = call i32 @PyList_SetItem(ptr %14, i64 1, ptr %17) + %19 = call ptr @PyFloat_FromDouble(double 9.000000e+00) + %20 = call i32 @PyList_SetItem(ptr %14, i64 2, ptr %19) + %21 = call ptr @PyList_New(i64 3) + %22 = call i32 @PyList_SetItem(ptr %21, i64 0, ptr %0) + %23 = call i32 @PyList_SetItem(ptr %21, i64 1, ptr %7) + %24 = call i32 @PyList_SetItem(ptr %21, i64 2, ptr %14) + %25 = call ptr @PyList_New(i64 3) + %26 = call ptr @PyFloat_FromDouble(double 9.000000e+00) + %27 = call i32 @PyList_SetItem(ptr %25, i64 0, ptr %26) + %28 = call ptr @PyFloat_FromDouble(double 8.000000e+00) + %29 = call i32 @PyList_SetItem(ptr %25, i64 1, ptr %28) + %30 = call ptr @PyFloat_FromDouble(double 7.000000e+00) + %31 = call i32 @PyList_SetItem(ptr %25, i64 2, ptr %30) + %32 = call ptr @PyList_New(i64 3) + %33 = call ptr @PyFloat_FromDouble(double 6.000000e+00) + %34 = call i32 @PyList_SetItem(ptr %32, i64 0, ptr %33) + %35 = call ptr @PyFloat_FromDouble(double 5.000000e+00) + %36 = call i32 @PyList_SetItem(ptr %32, i64 1, ptr %35) + %37 = call ptr @PyFloat_FromDouble(double 4.000000e+00) + %38 = call i32 @PyList_SetItem(ptr %32, i64 2, ptr %37) + %39 = call ptr @PyList_New(i64 3) + %40 = call ptr @PyFloat_FromDouble(double 3.000000e+00) + %41 = call i32 @PyList_SetItem(ptr %39, i64 0, ptr %40) + %42 = call ptr @PyFloat_FromDouble(double 2.000000e+00) + %43 = call i32 @PyList_SetItem(ptr %39, i64 1, ptr %42) + %44 = call ptr @PyFloat_FromDouble(double 1.000000e+00) + %45 = call i32 @PyList_SetItem(ptr %39, i64 2, ptr %44) + %46 = call ptr @PyList_New(i64 3) + %47 = call i32 @PyList_SetItem(ptr %46, i64 0, ptr %25) + %48 = call i32 @PyList_SetItem(ptr %46, i64 1, ptr %32) + %49 = call i32 @PyList_SetItem(ptr %46, i64 2, ptr %39) + %50 = load ptr, ptr @__llgo_py.numpy.add, align 8 + %51 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %50, ptr %21, ptr %46, ptr null) + %52 = call ptr @PyObject_Str(ptr %21) + %53 = call ptr @PyUnicode_AsUTF8(ptr %52) + %54 = call i32 (ptr, ...) @printf(ptr @0, ptr %53) + %55 = call ptr @PyObject_Str(ptr %46) + %56 = call ptr @PyUnicode_AsUTF8(ptr %55) + %57 = call i32 (ptr, ...) @printf(ptr @1, ptr %56) + %58 = call ptr @PyObject_Str(ptr %51) + %59 = call ptr @PyUnicode_AsUTF8(ptr %58) + %60 = call i32 (ptr, ...) @printf(ptr @2, ptr %59) + ret void } declare void @"github.com/goplus/llgo/py/numpy.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @PyList_New(i64) declare ptr @PyFloat_FromDouble(double) diff --git a/compiler/cl/_testpy/max/out.ll b/compiler/cl/_testpy/max/out.ll index 0b444928..149cf05b 100644 --- a/compiler/cl/_testpy/max/out.ll +++ b/compiler/cl/_testpy/max/out.ll @@ -1,9 +1,7 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testpy/max' +source_filename = "github.com/goplus/llgo/compiler/cl/_testpy/max" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testpy/max.init$guard" = global i1 false, align 1 @__llgo_py.builtins.max = linkonce global ptr null, align 8 @__llgo_py.builtins.print = linkonce global ptr null, align 8 @__llgo_py.builtins.iter = linkonce global ptr null, align 8 @@ -12,13 +10,13 @@ source_filename = "main" @1 = private unnamed_addr constant [4 x i8] c"max\00", align 1 @2 = private unnamed_addr constant [6 x i8] c"print\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/max.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/max.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/max.init$guard", align 1 call void @"github.com/goplus/llgo/py/std.init"() %1 = load ptr, ptr @__llgo_py.builtins, align 8 call void (ptr, ...) @llgoLoadPyModSyms(ptr %1, ptr @0, ptr @__llgo_py.builtins.iter, ptr @1, ptr @__llgo_py.builtins.max, ptr @2, ptr @__llgo_py.builtins.print, ptr null) @@ -28,55 +26,49 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/max.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @PyFloat_FromDouble(double 3.000000e+00) - %3 = call ptr @PyFloat_FromDouble(double 9.000000e+00) - %4 = call ptr @PyFloat_FromDouble(double 2.300000e+01) - %5 = call ptr @PyFloat_FromDouble(double 1.000000e+02) - %6 = load ptr, ptr @__llgo_py.builtins.max, align 8 - %7 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %6, ptr %2, ptr %3, ptr %4, ptr %5, ptr null) - %8 = load ptr, ptr @__llgo_py.builtins.print, align 8 - %9 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %8, ptr %7, ptr null) - %10 = call ptr @PyList_New(i64 4) - %11 = call ptr @PyFloat_FromDouble(double 3.000000e+00) - %12 = call i32 @PyList_SetItem(ptr %10, i64 0, ptr %11) - %13 = call ptr @PyFloat_FromDouble(double 9.000000e+00) - %14 = call i32 @PyList_SetItem(ptr %10, i64 1, ptr %13) - %15 = call ptr @PyFloat_FromDouble(double 2.300000e+01) - %16 = call i32 @PyList_SetItem(ptr %10, i64 2, ptr %15) - %17 = call ptr @PyFloat_FromDouble(double 1.000000e+02) - %18 = call i32 @PyList_SetItem(ptr %10, i64 3, ptr %17) - %19 = load ptr, ptr @__llgo_py.builtins.iter, align 8 - %20 = call ptr @PyObject_CallOneArg(ptr %19, ptr %10) - %21 = load ptr, ptr @__llgo_py.builtins.max, align 8 + %0 = call ptr @PyFloat_FromDouble(double 3.000000e+00) + %1 = call ptr @PyFloat_FromDouble(double 9.000000e+00) + %2 = call ptr @PyFloat_FromDouble(double 2.300000e+01) + %3 = call ptr @PyFloat_FromDouble(double 1.000000e+02) + %4 = load ptr, ptr @__llgo_py.builtins.max, align 8 + %5 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %4, ptr %0, ptr %1, ptr %2, ptr %3, ptr null) + %6 = load ptr, ptr @__llgo_py.builtins.print, align 8 + %7 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %6, ptr %5, ptr null) + %8 = call ptr @PyList_New(i64 4) + %9 = call ptr @PyFloat_FromDouble(double 3.000000e+00) + %10 = call i32 @PyList_SetItem(ptr %8, i64 0, ptr %9) + %11 = call ptr @PyFloat_FromDouble(double 9.000000e+00) + %12 = call i32 @PyList_SetItem(ptr %8, i64 1, ptr %11) + %13 = call ptr @PyFloat_FromDouble(double 2.300000e+01) + %14 = call i32 @PyList_SetItem(ptr %8, i64 2, ptr %13) + %15 = call ptr @PyFloat_FromDouble(double 1.000000e+02) + %16 = call i32 @PyList_SetItem(ptr %8, i64 3, ptr %15) + %17 = load ptr, ptr @__llgo_py.builtins.iter, align 8 + %18 = call ptr @PyObject_CallOneArg(ptr %17, ptr %8) + %19 = load ptr, ptr @__llgo_py.builtins.max, align 8 + %20 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %19, ptr %18, ptr null) + %21 = load ptr, ptr @__llgo_py.builtins.print, align 8 %22 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %21, ptr %20, ptr null) - %23 = load ptr, ptr @__llgo_py.builtins.print, align 8 - %24 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %23, ptr %22, ptr null) - %25 = call ptr @PyTuple_New(i64 3) - %26 = call ptr @PyFloat_FromDouble(double 1.000000e+00) - %27 = call i32 @PyTuple_SetItem(ptr %25, i64 0, ptr %26) - %28 = call ptr @PyFloat_FromDouble(double 2.000000e+00) - %29 = call i32 @PyTuple_SetItem(ptr %25, i64 1, ptr %28) - %30 = call ptr @PyFloat_FromDouble(double 3.000000e+00) - %31 = call i32 @PyTuple_SetItem(ptr %25, i64 2, ptr %30) - %32 = load ptr, ptr @__llgo_py.builtins.iter, align 8 - %33 = call ptr @PyObject_CallOneArg(ptr %32, ptr %25) - %34 = load ptr, ptr @__llgo_py.builtins.max, align 8 + %23 = call ptr @PyTuple_New(i64 3) + %24 = call ptr @PyFloat_FromDouble(double 1.000000e+00) + %25 = call i32 @PyTuple_SetItem(ptr %23, i64 0, ptr %24) + %26 = call ptr @PyFloat_FromDouble(double 2.000000e+00) + %27 = call i32 @PyTuple_SetItem(ptr %23, i64 1, ptr %26) + %28 = call ptr @PyFloat_FromDouble(double 3.000000e+00) + %29 = call i32 @PyTuple_SetItem(ptr %23, i64 2, ptr %28) + %30 = load ptr, ptr @__llgo_py.builtins.iter, align 8 + %31 = call ptr @PyObject_CallOneArg(ptr %30, ptr %23) + %32 = load ptr, ptr @__llgo_py.builtins.max, align 8 + %33 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %32, ptr %31, ptr null) + %34 = load ptr, ptr @__llgo_py.builtins.print, align 8 %35 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %34, ptr %33, ptr null) - %36 = load ptr, ptr @__llgo_py.builtins.print, align 8 - %37 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %36, ptr %35, ptr null) - ret i32 0 + ret void } declare void @"github.com/goplus/llgo/py/std.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @PyFloat_FromDouble(double) declare ptr @PyObject_CallFunctionObjArgs(ptr, ...) diff --git a/compiler/cl/_testpy/pi/out.ll b/compiler/cl/_testpy/pi/out.ll index 5af4e5e6..ebba35b0 100644 --- a/compiler/cl/_testpy/pi/out.ll +++ b/compiler/cl/_testpy/pi/out.ll @@ -1,20 +1,18 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testpy/pi' +source_filename = "github.com/goplus/llgo/compiler/cl/_testpy/pi" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testpy/pi.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [9 x i8] c"pi = %f\0A\00", align 1 @__llgo_py.math = external global ptr, align 8 @1 = private unnamed_addr constant [3 x i8] c"pi\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/pi.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/pi.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/pi.init$guard", align 1 call void @"github.com/goplus/llgo/py/math.init"() br label %_llgo_2 @@ -22,23 +20,17 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/pi.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @__llgo_py.math, align 8 - %3 = call ptr @PyObject_GetAttrString(ptr %2, ptr @1) - %4 = call double @PyFloat_AsDouble(ptr %3) - %5 = call i32 (ptr, ...) @printf(ptr @0, double %4) - ret i32 0 + %0 = load ptr, ptr @__llgo_py.math, align 8 + %1 = call ptr @PyObject_GetAttrString(ptr %0, ptr @1) + %2 = call double @PyFloat_AsDouble(ptr %1) + %3 = call i32 (ptr, ...) @printf(ptr @0, double %2) + ret void } declare void @"github.com/goplus/llgo/py/math.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @PyObject_GetAttrString(ptr, ptr) declare double @PyFloat_AsDouble(ptr) diff --git a/compiler/cl/_testpy/pow/out.ll b/compiler/cl/_testpy/pow/out.ll index 4f6b881a..ee56d6ad 100644 --- a/compiler/cl/_testpy/pow/out.ll +++ b/compiler/cl/_testpy/pow/out.ll @@ -1,21 +1,19 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testpy/pow' +source_filename = "github.com/goplus/llgo/compiler/cl/_testpy/pow" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testpy/pow.init$guard" = global i1 false, align 1 @__llgo_py.math.pow = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [16 x i8] c"pow(2, 3) = %f\0A\00", align 1 @__llgo_py.math = external global ptr, align 8 @1 = private unnamed_addr constant [4 x i8] c"pow\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/pow.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/pow.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testpy/pow.init$guard", align 1 call void @"github.com/goplus/llgo/py/math.init"() %1 = load ptr, ptr @__llgo_py.math, align 8 call void (ptr, ...) @llgoLoadPyModSyms(ptr %1, ptr @1, ptr @__llgo_py.math.pow, ptr null) @@ -25,25 +23,19 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testpy/pow.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @PyFloat_FromDouble(double 2.000000e+00) - %3 = call ptr @PyFloat_FromDouble(double 3.000000e+00) - %4 = load ptr, ptr @__llgo_py.math.pow, align 8 - %5 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %4, ptr %2, ptr %3, ptr null) - %6 = call double @PyFloat_AsDouble(ptr %5) - %7 = call i32 (ptr, ...) @printf(ptr @0, double %6) - ret i32 0 + %0 = call ptr @PyFloat_FromDouble(double 2.000000e+00) + %1 = call ptr @PyFloat_FromDouble(double 3.000000e+00) + %2 = load ptr, ptr @__llgo_py.math.pow, align 8 + %3 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %2, ptr %0, ptr %1, ptr null) + %4 = call double @PyFloat_AsDouble(ptr %3) + %5 = call i32 (ptr, ...) @printf(ptr @0, double %4) + ret void } declare void @"github.com/goplus/llgo/py/math.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @PyFloat_FromDouble(double) declare ptr @PyObject_CallFunctionObjArgs(ptr, ...) diff --git a/compiler/cl/_testrt/abinamed/out.ll b/compiler/cl/_testrt/abinamed/out.ll index 54665aa1..9aaf070a 100644 --- a/compiler/cl/_testrt/abinamed/out.ll +++ b/compiler/cl/_testrt/abinamed/out.ll @@ -1,23 +1,21 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/abinamed' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/abinamed" -%main.T = type { ptr, ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" } +%"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T" = type { ptr, ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/abi.Type" = type { i64, i64, i32, i8, i8, i8, i8, { ptr, ptr }, ptr, %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.eface = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/abi.StructType" = type { %"github.com/goplus/llgo/runtime/abi.Type", %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.Slice" } %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -@_llgo_main.T = linkonce global ptr null, align 8 -@0 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.init$guard" = global i1 false, align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T" = linkonce global ptr null, align 8 +@0 = private unnamed_addr constant [51 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/abinamed", align 1 @1 = private unnamed_addr constant [1 x i8] c"T", align 1 -@"*_llgo_main.T" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T" = linkonce global ptr null, align 8 @"_llgo_github.com/goplus/llgo/runtime/abi.Type" = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [34 x i8] c"github.com/goplus/llgo/runtime/abi", align 1 @3 = private unnamed_addr constant [4 x i8] c"Type", align 1 @@ -29,14 +27,14 @@ source_filename = "main" @_llgo_Pointer = linkonce global ptr null, align 8 @_llgo_bool = linkonce global ptr null, align 8 @"_llgo_func$fC75jGwF1nV5TF91gEeTF_JCtbG9Z7_yOawHBxqBh6E" = linkonce global ptr null, align 8 -@"main.struct$6Ehc6TOqEXOG056rtIWcVOuWzJK8QENYOqW7yQ1sEPU" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$6Ehc6TOqEXOG056rtIWcVOuWzJK8QENYOqW7yQ1sEPU" = linkonce global ptr null, align 8 @5 = private unnamed_addr constant [2 x i8] c"$f", align 1 @6 = private unnamed_addr constant [5 x i8] c"$data", align 1 @_llgo_byte = linkonce global ptr null, align 8 @"*_llgo_byte" = linkonce global ptr null, align 8 @_llgo_string = linkonce global ptr null, align 8 @"*_llgo_github.com/goplus/llgo/runtime/abi.Type" = linkonce global ptr null, align 8 -@"main.struct$-sQ1S_TW5WNLDageftHP017iwpTTWpvZTx7xZ5oHpvI" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$rDuZQXjMH4bpTOSCKOPXfXtIjD6YwQ9oTASrJ2N76VQ" = linkonce global ptr null, align 8 @7 = private unnamed_addr constant [5 x i8] c"Size_", align 1 @8 = private unnamed_addr constant [8 x i8] c"PtrBytes", align 1 @9 = private unnamed_addr constant [4 x i8] c"Hash", align 1 @@ -108,9 +106,9 @@ source_filename = "main" @46 = private unnamed_addr constant [7 x i8] c"MapType", align 1 @"_llgo_github.com/goplus/llgo/runtime/abi.MapType" = linkonce global ptr null, align 8 @"_llgo_func$ahHMZCcDhfW-lrs446sPkiW0NoVa2vpmK_wKarVa_20" = linkonce global ptr null, align 8 -@"main.struct$Oy3XhjARgY_pH1HU6oBj0nSC2Qs1A6CU4bRajpBttZc" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$Oy3XhjARgY_pH1HU6oBj0nSC2Qs1A6CU4bRajpBttZc" = linkonce global ptr null, align 8 @_llgo_uint16 = linkonce global ptr null, align 8 -@"main.struct$fcvaNpt6kbBgWOAYzHzrrsaKXunEtzMD4RdymMNJqTs" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$cKxX1dk_4FUaJkVYGogwwhApUh157NiM4dYa4KgJkeI" = linkonce global ptr null, align 8 @47 = private unnamed_addr constant [6 x i8] c"Bucket", align 1 @48 = private unnamed_addr constant [6 x i8] c"Hasher", align 1 @49 = private unnamed_addr constant [7 x i8] c"KeySize", align 1 @@ -157,8 +155,8 @@ source_filename = "main" @75 = private unnamed_addr constant [5 x i8] c"Mtyp_", align 1 @76 = private unnamed_addr constant [4 x i8] c"Ifn_", align 1 @77 = private unnamed_addr constant [4 x i8] c"Tfn_", align 1 -@"[]_llgo_main.T" = linkonce global ptr null, align 8 -@"main.struct$0I14CsQEZ9iadCku0_1cAZfCJoBbFdmFH4XChi4XRoo" = linkonce global ptr null, align 8 +@"[]_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$ZLmusojvth_AeIAGC574HWDNbqH0qIBjDCc2msmnDYs" = linkonce global ptr null, align 8 @78 = private unnamed_addr constant [1 x i8] c"p", align 1 @79 = private unnamed_addr constant [1 x i8] c"t", align 1 @80 = private unnamed_addr constant [1 x i8] c"n", align 1 @@ -170,238 +168,234 @@ source_filename = "main" @86 = private unnamed_addr constant [13 x i8] c"error field 2", align 1 @87 = private unnamed_addr constant [13 x i8] c"error field 3", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.init$guard", align 1 call void @"github.com/goplus/llgo/runtime/abi.init"() - call void @"main.init$after"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @_llgo_main.T, align 8 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) - store %main.T zeroinitializer, ptr %3, align 8 - %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 - %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %4, ptr %3, 1 - %6 = call ptr @main.toEface(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %5) - %7 = load ptr, ptr @"_llgo_github.com/goplus/llgo/runtime/abi.Type", align 8 - %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 72) - store %"github.com/goplus/llgo/runtime/abi.Type" zeroinitializer, ptr %8, align 8 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %7, 0 - %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, ptr %8, 1 - %11 = call ptr @main.toEface(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %10) - %12 = getelementptr inbounds %main.eface, ptr %6, i32 0, i32 0 - %13 = load ptr, ptr %12, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %13) + %0 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) + store %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T" zeroinitializer, ptr %1, align 8 + %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 + %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, ptr %1, 1 + %4 = call ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.toEface"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %3) + %5 = load ptr, ptr @"_llgo_github.com/goplus/llgo/runtime/abi.Type", align 8 + %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 72) + store %"github.com/goplus/llgo/runtime/abi.Type" zeroinitializer, ptr %6, align 8 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %5, 0 + %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr %6, 1 + %9 = call ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.toEface"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %8) + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %4, i32 0, i32 0 + %11 = load ptr, ptr %10, align 8 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %11) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %14 = getelementptr inbounds %main.eface, ptr %6, i32 0, i32 0 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %4, i32 0, i32 0 + %13 = load ptr, ptr %12, align 8 + %14 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %13, i32 0, i32 10 %15 = load ptr, ptr %14, align 8 - %16 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %15, i32 0, i32 10 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %15) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) + %16 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %9, i32 0, i32 0 %17 = load ptr, ptr %16, align 8 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %17) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %18 = getelementptr inbounds %main.eface, ptr %11, i32 0, i32 0 + %18 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %9, i32 0, i32 0 %19 = load ptr, ptr %18, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %19) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %20 = getelementptr inbounds %main.eface, ptr %11, i32 0, i32 0 + %20 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %19, i32 0, i32 10 %21 = load ptr, ptr %20, align 8 - %22 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %21, i32 0, i32 10 - %23 = load ptr, ptr %22, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %23) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %21) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %24 = alloca %"github.com/goplus/llgo/runtime/abi.StructField", align 8 - call void @llvm.memset(ptr %24, i8 0, i64 56, i1 false) - %25 = getelementptr inbounds %main.eface, ptr %6, i32 0, i32 0 - %26 = load ptr, ptr %25, align 8 - %27 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %26) - %28 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %27, i32 0, i32 2 - %29 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %28, align 8 - %30 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29, 0 - %31 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29, 1 - %32 = icmp sge i64 0, %31 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %32) - %33 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %30, i64 0 - %34 = load %"github.com/goplus/llgo/runtime/abi.StructField", ptr %33, align 8 - store %"github.com/goplus/llgo/runtime/abi.StructField" %34, ptr %24, align 8 - %35 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %24, i32 0, i32 1 + %22 = alloca %"github.com/goplus/llgo/runtime/abi.StructField", align 8 + call void @llvm.memset(ptr %22, i8 0, i64 56, i1 false) + %23 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %4, i32 0, i32 0 + %24 = load ptr, ptr %23, align 8 + %25 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %24) + %26 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %25, i32 0, i32 2 + %27 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %26, align 8 + %28 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27, 0 + %29 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27, 1 + %30 = icmp sge i64 0, %29 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %30) + %31 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %28, i64 0 + %32 = load %"github.com/goplus/llgo/runtime/abi.StructField", ptr %31, align 8 + store %"github.com/goplus/llgo/runtime/abi.StructField" %32, ptr %22, align 8 + %33 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %22, i32 0, i32 1 + %34 = load ptr, ptr %33, align 8 + %35 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %4, i32 0, i32 0 %36 = load ptr, ptr %35, align 8 - %37 = getelementptr inbounds %main.eface, ptr %6, i32 0, i32 0 + %37 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %36, i32 0, i32 10 %38 = load ptr, ptr %37, align 8 - %39 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %38, i32 0, i32 10 - %40 = load ptr, ptr %39, align 8 - %41 = icmp ne ptr %36, %40 - br i1 %41, label %_llgo_1, label %_llgo_2 + %39 = icmp ne ptr %34, %38 + br i1 %39, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %42 = load ptr, ptr @_llgo_string, align 8 - %43 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @82, i64 13 }, ptr %43, align 8 - %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %42, 0 - %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %44, ptr %43, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %45) + %40 = load ptr, ptr @_llgo_string, align 8 + %41 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @82, i64 13 }, ptr %41, align 8 + %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %40, 0 + %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %42, ptr %41, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %43) unreachable _llgo_2: ; preds = %_llgo_0 - %46 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %24, i32 0, i32 1 - %47 = load ptr, ptr %46, align 8 - %48 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).Elem"(ptr %47) - %49 = getelementptr inbounds %main.eface, ptr %6, i32 0, i32 0 - %50 = load ptr, ptr %49, align 8 - %51 = icmp ne ptr %48, %50 - br i1 %51, label %_llgo_3, label %_llgo_4 + %44 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %22, i32 0, i32 1 + %45 = load ptr, ptr %44, align 8 + %46 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).Elem"(ptr %45) + %47 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %4, i32 0, i32 0 + %48 = load ptr, ptr %47, align 8 + %49 = icmp ne ptr %46, %48 + br i1 %49, label %_llgo_3, label %_llgo_4 _llgo_3: ; preds = %_llgo_2 - %52 = load ptr, ptr @_llgo_string, align 8 - %53 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @83, i64 18 }, ptr %53, align 8 - %54 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %52, 0 - %55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %54, ptr %53, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %55) + %50 = load ptr, ptr @_llgo_string, align 8 + %51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @83, i64 18 }, ptr %51, align 8 + %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %50, 0 + %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %52, ptr %51, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %53) unreachable _llgo_4: ; preds = %_llgo_2 - %56 = alloca %"github.com/goplus/llgo/runtime/abi.StructField", align 8 - call void @llvm.memset(ptr %56, i8 0, i64 56, i1 false) - %57 = getelementptr inbounds %main.eface, ptr %6, i32 0, i32 0 - %58 = load ptr, ptr %57, align 8 - %59 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %58) - %60 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %59, i32 0, i32 2 - %61 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %60, align 8 - %62 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61, 0 - %63 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61, 1 - %64 = icmp sge i64 1, %63 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %64) - %65 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %62, i64 1 - %66 = load %"github.com/goplus/llgo/runtime/abi.StructField", ptr %65, align 8 - store %"github.com/goplus/llgo/runtime/abi.StructField" %66, ptr %56, align 8 - %67 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %56, i32 0, i32 1 + %54 = alloca %"github.com/goplus/llgo/runtime/abi.StructField", align 8 + call void @llvm.memset(ptr %54, i8 0, i64 56, i1 false) + %55 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %4, i32 0, i32 0 + %56 = load ptr, ptr %55, align 8 + %57 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %56) + %58 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %57, i32 0, i32 2 + %59 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %58, align 8 + %60 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59, 0 + %61 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59, 1 + %62 = icmp sge i64 1, %61 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %62) + %63 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %60, i64 1 + %64 = load %"github.com/goplus/llgo/runtime/abi.StructField", ptr %63, align 8 + store %"github.com/goplus/llgo/runtime/abi.StructField" %64, ptr %54, align 8 + %65 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %54, i32 0, i32 1 + %66 = load ptr, ptr %65, align 8 + %67 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %9, i32 0, i32 0 %68 = load ptr, ptr %67, align 8 - %69 = getelementptr inbounds %main.eface, ptr %11, i32 0, i32 0 + %69 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %68, i32 0, i32 10 %70 = load ptr, ptr %69, align 8 - %71 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %70, i32 0, i32 10 - %72 = load ptr, ptr %71, align 8 - %73 = icmp ne ptr %68, %72 - br i1 %73, label %_llgo_5, label %_llgo_6 + %71 = icmp ne ptr %66, %70 + br i1 %71, label %_llgo_5, label %_llgo_6 _llgo_5: ; preds = %_llgo_4 - %74 = load ptr, ptr @_llgo_string, align 8 - %75 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @84, i64 13 }, ptr %75, align 8 - %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %74, 0 - %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %76, ptr %75, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %77) + %72 = load ptr, ptr @_llgo_string, align 8 + %73 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @84, i64 13 }, ptr %73, align 8 + %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %72, 0 + %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %74, ptr %73, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %75) unreachable _llgo_6: ; preds = %_llgo_4 - %78 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %56, i32 0, i32 1 - %79 = load ptr, ptr %78, align 8 - %80 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).Elem"(ptr %79) - %81 = getelementptr inbounds %main.eface, ptr %11, i32 0, i32 0 - %82 = load ptr, ptr %81, align 8 - %83 = icmp ne ptr %80, %82 - br i1 %83, label %_llgo_7, label %_llgo_8 + %76 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %54, i32 0, i32 1 + %77 = load ptr, ptr %76, align 8 + %78 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).Elem"(ptr %77) + %79 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %9, i32 0, i32 0 + %80 = load ptr, ptr %79, align 8 + %81 = icmp ne ptr %78, %80 + br i1 %81, label %_llgo_7, label %_llgo_8 _llgo_7: ; preds = %_llgo_6 - %84 = load ptr, ptr @_llgo_string, align 8 - %85 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @85, i64 18 }, ptr %85, align 8 - %86 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %84, 0 - %87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %86, ptr %85, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %87) + %82 = load ptr, ptr @_llgo_string, align 8 + %83 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @85, i64 18 }, ptr %83, align 8 + %84 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %82, 0 + %85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %84, ptr %83, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %85) unreachable _llgo_8: ; preds = %_llgo_6 - %88 = alloca %"github.com/goplus/llgo/runtime/abi.StructField", align 8 - call void @llvm.memset(ptr %88, i8 0, i64 56, i1 false) - %89 = getelementptr inbounds %main.eface, ptr %6, i32 0, i32 0 - %90 = load ptr, ptr %89, align 8 - %91 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %90) - %92 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %91, i32 0, i32 2 - %93 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %92, align 8 - %94 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %93, 0 - %95 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %93, 1 - %96 = icmp sge i64 2, %95 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %96) - %97 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %94, i64 2 - %98 = load %"github.com/goplus/llgo/runtime/abi.StructField", ptr %97, align 8 - store %"github.com/goplus/llgo/runtime/abi.StructField" %98, ptr %88, align 8 - %99 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %88, i32 0, i32 1 + %86 = alloca %"github.com/goplus/llgo/runtime/abi.StructField", align 8 + call void @llvm.memset(ptr %86, i8 0, i64 56, i1 false) + %87 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %4, i32 0, i32 0 + %88 = load ptr, ptr %87, align 8 + %89 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %88) + %90 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %89, i32 0, i32 2 + %91 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %90, align 8 + %92 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %91, 0 + %93 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %91, 1 + %94 = icmp sge i64 2, %93 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %94) + %95 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %92, i64 2 + %96 = load %"github.com/goplus/llgo/runtime/abi.StructField", ptr %95, align 8 + store %"github.com/goplus/llgo/runtime/abi.StructField" %96, ptr %86, align 8 + %97 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %86, i32 0, i32 1 + %98 = load ptr, ptr %97, align 8 + %99 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %9, i32 0, i32 0 %100 = load ptr, ptr %99, align 8 - %101 = getelementptr inbounds %main.eface, ptr %11, i32 0, i32 0 - %102 = load ptr, ptr %101, align 8 - %103 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %102) - %104 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %103, i32 0, i32 2 - %105 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %104, align 8 - %106 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %105, 0 - %107 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %105, 1 - %108 = icmp sge i64 0, %107 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %108) - %109 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %106, i64 0 - %110 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %109, i32 0, i32 1 - %111 = load ptr, ptr %110, align 8 - %112 = icmp ne ptr %100, %111 - br i1 %112, label %_llgo_9, label %_llgo_10 + %101 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %100) + %102 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %101, i32 0, i32 2 + %103 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %102, align 8 + %104 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %103, 0 + %105 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %103, 1 + %106 = icmp sge i64 0, %105 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %106) + %107 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %104, i64 0 + %108 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %107, i32 0, i32 1 + %109 = load ptr, ptr %108, align 8 + %110 = icmp ne ptr %98, %109 + br i1 %110, label %_llgo_9, label %_llgo_10 _llgo_9: ; preds = %_llgo_8 - %113 = load ptr, ptr @_llgo_string, align 8 - %114 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @86, i64 13 }, ptr %114, align 8 - %115 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %113, 0 - %116 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %115, ptr %114, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %116) + %111 = load ptr, ptr @_llgo_string, align 8 + %112 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @86, i64 13 }, ptr %112, align 8 + %113 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %111, 0 + %114 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %113, ptr %112, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %114) unreachable _llgo_10: ; preds = %_llgo_8 - %117 = alloca %"github.com/goplus/llgo/runtime/abi.StructField", align 8 - call void @llvm.memset(ptr %117, i8 0, i64 56, i1 false) - %118 = getelementptr inbounds %main.eface, ptr %6, i32 0, i32 0 - %119 = load ptr, ptr %118, align 8 - %120 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %119) - %121 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %120, i32 0, i32 2 - %122 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %121, align 8 - %123 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %122, 0 - %124 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %122, 1 - %125 = icmp sge i64 3, %124 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %125) - %126 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %123, i64 3 - %127 = load %"github.com/goplus/llgo/runtime/abi.StructField", ptr %126, align 8 - store %"github.com/goplus/llgo/runtime/abi.StructField" %127, ptr %117, align 8 - %128 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %117, i32 0, i32 1 - %129 = load ptr, ptr %128, align 8 - %130 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).Elem"(ptr %129) - %131 = getelementptr inbounds %main.eface, ptr %6, i32 0, i32 0 - %132 = load ptr, ptr %131, align 8 - %133 = icmp ne ptr %130, %132 - br i1 %133, label %_llgo_11, label %_llgo_12 + %115 = alloca %"github.com/goplus/llgo/runtime/abi.StructField", align 8 + call void @llvm.memset(ptr %115, i8 0, i64 56, i1 false) + %116 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %4, i32 0, i32 0 + %117 = load ptr, ptr %116, align 8 + %118 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).StructType"(ptr %117) + %119 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructType", ptr %118, i32 0, i32 2 + %120 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %119, align 8 + %121 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %120, 0 + %122 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %120, 1 + %123 = icmp sge i64 3, %122 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %123) + %124 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %121, i64 3 + %125 = load %"github.com/goplus/llgo/runtime/abi.StructField", ptr %124, align 8 + store %"github.com/goplus/llgo/runtime/abi.StructField" %125, ptr %115, align 8 + %126 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.StructField", ptr %115, i32 0, i32 1 + %127 = load ptr, ptr %126, align 8 + %128 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).Elem"(ptr %127) + %129 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.eface", ptr %4, i32 0, i32 0 + %130 = load ptr, ptr %129, align 8 + %131 = icmp ne ptr %128, %130 + br i1 %131, label %_llgo_11, label %_llgo_12 _llgo_11: ; preds = %_llgo_10 - %134 = load ptr, ptr @_llgo_string, align 8 - %135 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @87, i64 13 }, ptr %135, align 8 - %136 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %134, 0 - %137 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %136, ptr %135, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %137) + %132 = load ptr, ptr @_llgo_string, align 8 + %133 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @87, i64 13 }, ptr %133, align 8 + %134 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %132, 0 + %135 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %134, ptr %133, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %135) unreachable _llgo_12: ; preds = %_llgo_10 - ret i32 0 + ret void } -define ptr @main.toEface(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.toEface"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, ptr %1, align 8 @@ -410,34 +404,32 @@ _llgo_0: declare void @"github.com/goplus/llgo/runtime/abi.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) - %1 = load ptr, ptr @_llgo_main.T, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) + %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %0, ptr @_llgo_main.T, align 8 + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 - %3 = load ptr, ptr @_llgo_main.T, align 8 - %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) - %5 = load ptr, ptr @"*_llgo_main.T", align 8 + %3 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 + %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) + %5 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 %6 = icmp eq ptr %5, null br i1 %6, label %_llgo_3, label %_llgo_4 _llgo_3: ; preds = %_llgo_2 %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %4) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %7) - store ptr %7, ptr @"*_llgo_main.T", align 8 + store ptr %7, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 br label %_llgo_4 _llgo_4: ; preds = %_llgo_3, %_llgo_2 - %8 = load ptr, ptr @"*_llgo_main.T", align 8 + %8 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 34 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, i64 25, i64 80, i64 0, i64 23) %10 = load ptr, ptr @"_llgo_github.com/goplus/llgo/runtime/abi.Type", align 8 %11 = icmp eq ptr %10, null @@ -580,9 +572,9 @@ _llgo_22: ; preds = %_llgo_21, %_llgo_20 %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %72, 0 %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75, i64 2, 1 %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76, i64 2, 2 - %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77) - store ptr %78, ptr @"main.struct$6Ehc6TOqEXOG056rtIWcVOuWzJK8QENYOqW7yQ1sEPU", align 8 - %79 = load ptr, ptr @"main.struct$6Ehc6TOqEXOG056rtIWcVOuWzJK8QENYOqW7yQ1sEPU", align 8 + %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77) + store ptr %78, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$6Ehc6TOqEXOG056rtIWcVOuWzJK8QENYOqW7yQ1sEPU", align 8 + %79 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$6Ehc6TOqEXOG056rtIWcVOuWzJK8QENYOqW7yQ1sEPU", align 8 %80 = load ptr, ptr @_llgo_byte, align 8 %81 = icmp eq ptr %80, null br i1 %81, label %_llgo_23, label %_llgo_24 @@ -676,7 +668,7 @@ _llgo_30: ; preds = %_llgo_29, %_llgo_28 %135 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %132, 0 %136 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %135, i64 2, 1 %137 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %136, i64 2, 2 - %138 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %137) + %138 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %137) %139 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @13, i64 5 }, ptr %138, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %140 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 40) %141 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %140) @@ -711,9 +703,9 @@ _llgo_30: ; preds = %_llgo_29, %_llgo_28 %159 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %147, 0 %160 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %159, i64 11, 1 %161 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %160, i64 11, 2 - %162 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 72, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %161) - store ptr %162, ptr @"main.struct$-sQ1S_TW5WNLDageftHP017iwpTTWpvZTx7xZ5oHpvI", align 8 - %163 = load ptr, ptr @"main.struct$-sQ1S_TW5WNLDageftHP017iwpTTWpvZTx7xZ5oHpvI", align 8 + %162 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 72, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %161) + store ptr %162, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$rDuZQXjMH4bpTOSCKOPXfXtIjD6YwQ9oTASrJ2N76VQ", align 8 + %163 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$rDuZQXjMH4bpTOSCKOPXfXtIjD6YwQ9oTASrJ2N76VQ", align 8 br i1 %11, label %_llgo_31, label %_llgo_32 _llgo_31: ; preds = %_llgo_30 @@ -724,8 +716,8 @@ _llgo_31: ; preds = %_llgo_30 _llgo_32: ; preds = %_llgo_40, %_llgo_30 %166 = load ptr, ptr @"_llgo_github.com/goplus/llgo/runtime/abi.Type", align 8 %167 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/runtime/abi.Type", align 8 - %168 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) - %169 = load ptr, ptr @"[]_llgo_main.T", align 8 + %168 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) + %169 = load ptr, ptr @"[]_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 %170 = icmp eq ptr %169, null br i1 %170, label %_llgo_133, label %_llgo_134 @@ -796,7 +788,7 @@ _llgo_38: ; preds = %_llgo_37, %_llgo_36 %210 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %205, 0 %211 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %210, i64 4, 1 %212 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %211, i64 4, 2 - %213 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 96, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %212) + %213 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 96, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %212) store ptr %213, ptr @"_llgo_struct$_wxpay9lRP3cWU1eNzUY8uwDJyoHmQ6toXBadyiL6io", align 8 %214 = load ptr, ptr @"_llgo_struct$_wxpay9lRP3cWU1eNzUY8uwDJyoHmQ6toXBadyiL6io", align 8 br i1 %192, label %_llgo_39, label %_llgo_40 @@ -1125,7 +1117,7 @@ _llgo_58: ; preds = %_llgo_57, %_llgo_56 %435 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %431, 0 %436 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %435, i64 3, 1 %437 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %436, i64 3, 2 - %438 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 120, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %437) + %438 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 120, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %437) store ptr %438, ptr @"_llgo_struct$1ug-gfLTkNOIzG-RN7EFFwGKI01E7iqUGVZBMudT8KA", align 8 %439 = load ptr, ptr @"_llgo_struct$1ug-gfLTkNOIzG-RN7EFFwGKI01E7iqUGVZBMudT8KA", align 8 br i1 %411, label %_llgo_59, label %_llgo_60 @@ -1183,7 +1175,7 @@ _llgo_60: ; preds = %_llgo_82, %_llgo_58 %482 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %477, 0 %483 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %482, i64 4, 1 %484 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %483, i64 4, 2 - %485 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 40, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %484) + %485 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 40, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %484) store ptr %485, ptr @"_llgo_struct$jXUHcnL1PMmNRB-pn2cBRAQ7OYcwCM_YkvLqlL0ZYaE", align 8 %486 = load ptr, ptr @"_llgo_struct$jXUHcnL1PMmNRB-pn2cBRAQ7OYcwCM_YkvLqlL0ZYaE", align 8 br i1 %408, label %_llgo_131, label %_llgo_132 @@ -1328,7 +1320,7 @@ _llgo_74: ; preds = %_llgo_73, %_llgo_72 %568 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %565, 0 %569 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %568, i64 2, 1 %570 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %569, i64 2, 2 - %571 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %570) + %571 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %570) store ptr %571, ptr @"_llgo_struct$nK3p3a0VXRT6CeR0p3-gSrD3XdcHx2I7dlhqG-Zjudw", align 8 %572 = load ptr, ptr @"_llgo_struct$nK3p3a0VXRT6CeR0p3-gSrD3XdcHx2I7dlhqG-Zjudw", align 8 br i1 %558, label %_llgo_75, label %_llgo_76 @@ -1412,7 +1404,7 @@ _llgo_80: ; preds = %_llgo_79, %_llgo_76 %622 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %618, 0 %623 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %622, i64 3, 1 %624 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %623, i64 3, 2 - %625 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 112, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %624) + %625 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 112, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %624) store ptr %625, ptr @"_llgo_struct$eoXJdAUqA_SyytMpb3QTBaQ2Bh9nLc089-gvCiW55io", align 8 %626 = load ptr, ptr @"_llgo_struct$eoXJdAUqA_SyytMpb3QTBaQ2Bh9nLc089-gvCiW55io", align 8 br i1 %555, label %_llgo_81, label %_llgo_82 @@ -1781,9 +1773,9 @@ _llgo_98: ; preds = %_llgo_97, %_llgo_96 %887 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %884, 0 %888 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %887, i64 2, 1 %889 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %888, i64 2, 2 - %890 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %889) - store ptr %890, ptr @"main.struct$Oy3XhjARgY_pH1HU6oBj0nSC2Qs1A6CU4bRajpBttZc", align 8 - %891 = load ptr, ptr @"main.struct$Oy3XhjARgY_pH1HU6oBj0nSC2Qs1A6CU4bRajpBttZc", align 8 + %890 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %889) + store ptr %890, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$Oy3XhjARgY_pH1HU6oBj0nSC2Qs1A6CU4bRajpBttZc", align 8 + %891 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$Oy3XhjARgY_pH1HU6oBj0nSC2Qs1A6CU4bRajpBttZc", align 8 %892 = load ptr, ptr @_llgo_uint16, align 8 %893 = icmp eq ptr %892, null br i1 %893, label %_llgo_99, label %_llgo_100 @@ -1835,7 +1827,7 @@ _llgo_100: ; preds = %_llgo_99, %_llgo_98 %928 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %925, 0 %929 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %928, i64 2, 1 %930 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %929, i64 2, 2 - %931 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %930) + %931 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %930) %932 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @48, i64 6 }, ptr %931, i64 96, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %933 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 40) %934 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @49, i64 7 }, ptr %933, i64 112, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) @@ -1867,9 +1859,9 @@ _llgo_100: ; preds = %_llgo_99, %_llgo_98 %951 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %941, 0 %952 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %951, i64 9, 1 %953 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %952, i64 9, 2 - %954 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 120, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %953) - store ptr %954, ptr @"main.struct$fcvaNpt6kbBgWOAYzHzrrsaKXunEtzMD4RdymMNJqTs", align 8 - %955 = load ptr, ptr @"main.struct$fcvaNpt6kbBgWOAYzHzrrsaKXunEtzMD4RdymMNJqTs", align 8 + %954 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 120, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %953) + store ptr %954, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$cKxX1dk_4FUaJkVYGogwwhApUh157NiM4dYa4KgJkeI", align 8 + %955 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$cKxX1dk_4FUaJkVYGogwwhApUh157NiM4dYa4KgJkeI", align 8 br i1 %844, label %_llgo_101, label %_llgo_102 _llgo_101: ; preds = %_llgo_100 @@ -2162,7 +2154,7 @@ _llgo_112: ; preds = %_llgo_111, %_llgo_1 %1170 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %1164, 0 %1171 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1170, i64 5, 1 %1172 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1171, i64 5, 2 - %1173 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 56, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1172) + %1173 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 56, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1172) store ptr %1173, ptr @"_llgo_struct$kJjSbRGD6vW5GBpnW3h2bqoH3rm-w30ibwmCd552LPU", align 8 %1174 = load ptr, ptr @"_llgo_struct$kJjSbRGD6vW5GBpnW3h2bqoH3rm-w30ibwmCd552LPU", align 8 br i1 %1151, label %_llgo_113, label %_llgo_114 @@ -2218,7 +2210,7 @@ _llgo_116: ; preds = %_llgo_115, %_llgo_1 %1206 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %1202, 0 %1207 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1206, i64 3, 1 %1208 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1207, i64 3, 2 - %1209 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 112, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1208) + %1209 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 112, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1208) store ptr %1209, ptr @"_llgo_struct$a40Ph0zKu8cPeYh4GJjFLIY8XDqrC7uc-XzprrJaUh0", align 8 %1210 = load ptr, ptr @"_llgo_struct$a40Ph0zKu8cPeYh4GJjFLIY8XDqrC7uc-XzprrJaUh0", align 8 br i1 %1148, label %_llgo_117, label %_llgo_118 @@ -2455,7 +2447,7 @@ _llgo_124: ; preds = %_llgo_123, %_llgo_1 %1381 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %1376, 0 %1382 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1381, i64 4, 1 %1383 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1382, i64 4, 2 - %1384 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1383) + %1384 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1383) store ptr %1384, ptr @"_llgo_struct$OKIlItfBJsawrEMnVSc2VQ7pxNxCHIgSoitcM9n4FVI", align 8 %1385 = load ptr, ptr @"_llgo_struct$OKIlItfBJsawrEMnVSc2VQ7pxNxCHIgSoitcM9n4FVI", align 8 br i1 %1367, label %_llgo_125, label %_llgo_126 @@ -2729,14 +2721,14 @@ _llgo_132: ; preds = %_llgo_131, %_llgo_6 _llgo_133: ; preds = %_llgo_32 %1571 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.SliceOf"(ptr %168) - store ptr %1571, ptr @"[]_llgo_main.T", align 8 + store ptr %1571, ptr @"[]_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 br label %_llgo_134 _llgo_134: ; preds = %_llgo_133, %_llgo_32 - %1572 = load ptr, ptr @"[]_llgo_main.T", align 8 - %1573 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) + %1572 = load ptr, ptr @"[]_llgo_github.com/goplus/llgo/compiler/cl/_testrt/abinamed.T", align 8 + %1573 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) %1574 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 34 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 }, i64 25, i64 80, i64 0, i64 23) - %1575 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) + %1575 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, i64 25, i64 48, i64 0, i64 0) %1576 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %1573) %1577 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @78, i64 1 }, ptr %1576, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %1578 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %1574) @@ -2757,9 +2749,9 @@ _llgo_134: ; preds = %_llgo_133, %_llgo_3 %1589 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %1584, 0 %1590 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1589, i64 4, 1 %1591 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1590, i64 4, 2 - %1592 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 48, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1591) - store ptr %1592, ptr @"main.struct$0I14CsQEZ9iadCku0_1cAZfCJoBbFdmFH4XChi4XRoo", align 8 - %1593 = load ptr, ptr @"main.struct$0I14CsQEZ9iadCku0_1cAZfCJoBbFdmFH4XChi4XRoo", align 8 + %1592 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 51 }, i64 48, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1591) + store ptr %1592, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$ZLmusojvth_AeIAGC574HWDNbqH0qIBjDCc2msmnDYs", align 8 + %1593 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/abinamed.struct$ZLmusojvth_AeIAGC574HWDNbqH0qIBjDCc2msmnDYs", align 8 br i1 %2, label %_llgo_135, label %_llgo_136 _llgo_135: ; preds = %_llgo_134 diff --git a/compiler/cl/_testrt/alloca/out.ll b/compiler/cl/_testrt/alloca/out.ll index b467901a..2e15f811 100644 --- a/compiler/cl/_testrt/alloca/out.ll +++ b/compiler/cl/_testrt/alloca/out.ll @@ -1,39 +1,31 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/alloca' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/alloca" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/alloca.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [4 x i8] c"Hi\0A\00", align 1 @1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/alloca.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/alloca.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/alloca.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/alloca.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = alloca i8, i64 4, align 1 - %3 = call ptr @memcpy(ptr %2, ptr @0, i64 4) - %4 = call i32 (ptr, ...) @printf(ptr @1, ptr %2) - ret i32 0 + %0 = alloca i8, i64 4, align 1 + %1 = call ptr @memcpy(ptr %0, ptr @0, i64 4) + %2 = call i32 (ptr, ...) @printf(ptr @1, ptr %0) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @memcpy(ptr, ptr, i64) declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testrt/allocstr/out.ll b/compiler/cl/_testrt/allocstr/out.ll index a25fa814..328dd3b5 100644 --- a/compiler/cl/_testrt/allocstr/out.ll +++ b/compiler/cl/_testrt/allocstr/out.ll @@ -1,48 +1,40 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/allocstr' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/allocstr" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/allocstr.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [12 x i8] c"Hello world\0A", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @main.hello() { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testrt/allocstr.hello"() { _llgo_0: ret %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 12 } } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/allocstr.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/allocstr.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/allocstr.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/allocstr.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @main.hello() - %3 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %2, 1 - %4 = add i64 %3, 1 - %5 = alloca i8, i64 %4, align 1 - %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.CStrCopy"(ptr %5, %"github.com/goplus/llgo/runtime/internal/runtime.String" %2) - %7 = call i32 (ptr, ...) @printf(ptr %6) - ret i32 0 + %0 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testrt/allocstr.hello"() + %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %0, 1 + %2 = add i64 %1, 1 + %3 = alloca i8, i64 %2, align 1 + %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.CStrCopy"(ptr %3, %"github.com/goplus/llgo/runtime/internal/runtime.String" %0) + %5 = call i32 (ptr, ...) @printf(ptr %4) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.CStrCopy"(ptr, %"github.com/goplus/llgo/runtime/internal/runtime.String") declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testrt/any/out.ll b/compiler/cl/_testrt/any/out.ll index 4fde564d..a2c80f48 100644 --- a/compiler/cl/_testrt/any/out.ll +++ b/compiler/cl/_testrt/any/out.ll @@ -1,21 +1,19 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/any' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/any" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/any.init$guard" = global i1 false, align 1 @_llgo_int8 = linkonce global ptr null, align 8 @"*_llgo_int8" = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 @_llgo_string = linkonce global ptr null, align 8 @_llgo_int = linkonce global ptr null, align 8 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @1 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 @2 = private unnamed_addr constant [6 x i8] c"Hello\00", align 1 -define ptr @main.hi(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testrt/any.hi"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 0 %2 = load ptr, ptr @_llgo_int8, align 8 @@ -37,7 +35,7 @@ _llgo_2: ; preds = %_llgo_0 unreachable } -define i64 @main.incVal(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/any.incVal"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 0 %2 = load ptr, ptr @_llgo_int, align 8 @@ -60,39 +58,35 @@ _llgo_2: ; preds = %_llgo_0 unreachable } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/any.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/any.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/any.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/any.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/any.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @"*_llgo_int8", align 8 - %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 - %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, ptr @2, 1 - %5 = call ptr @main.hi(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %4) - %6 = load ptr, ptr @_llgo_int, align 8 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %6, 0 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr inttoptr (i64 100 to ptr), 1 - %9 = call i64 @main.incVal(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %8) - %10 = call i32 (ptr, ...) @printf(ptr @1, ptr %5, i64 %9) - ret i32 0 + %0 = load ptr, ptr @"*_llgo_int8", align 8 + %1 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 + %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %1, ptr @2, 1 + %3 = call ptr @"github.com/goplus/llgo/compiler/cl/_testrt/any.hi"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %2) + %4 = load ptr, ptr @_llgo_int, align 8 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr inttoptr (i64 100 to ptr), 1 + %7 = call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/any.incVal"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %6) + %8 = call i32 (ptr, ...) @printf(ptr @1, ptr %3, i64 %7) + ret void } -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/any.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_int8, align 8 %1 = icmp eq ptr %0, null @@ -149,6 +143,4 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testrt/builtin/out.ll b/compiler/cl/_testrt/builtin/out.ll index 3a19e73f..c7d798d0 100644 --- a/compiler/cl/_testrt/builtin/out.ll +++ b/compiler/cl/_testrt/builtin/out.ll @@ -1,16 +1,14 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/builtin' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/builtin" %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -@main.a = global i64 0, align 8 -@main.b = global i64 0, align 8 -@"main.init$guard" = global i1 false, align 1 -@main.n = global i64 0, align 8 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/builtin.a" = global i64 0, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/builtin.b" = global i64 0, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/builtin.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/builtin.n" = global i64 0, align 8 @0 = private unnamed_addr constant [5 x i8] c"hello", align 1 @1 = private unnamed_addr constant [3 x i8] c"def", align 1 @_llgo_int = linkonce global ptr null, align 8 @@ -20,7 +18,7 @@ source_filename = "main" @5 = private unnamed_addr constant [3 x i8] c"abd", align 1 @6 = private unnamed_addr constant [2 x i8] c"fn", align 1 -define double @main.Float64frombits(i64 %0) { +define double @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.Float64frombits"(i64 %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) store i64 %0, ptr %1, align 4 @@ -28,7 +26,7 @@ _llgo_0: ret double %2 } -define double @main.Inf(i64 %0) { +define double @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.Inf"(i64 %0) { _llgo_0: %1 = icmp sge i64 %0, 0 br i1 %1, label %_llgo_1, label %_llgo_3 @@ -38,92 +36,88 @@ _llgo_1: ; preds = %_llgo_0 _llgo_2: ; preds = %_llgo_3, %_llgo_1 %2 = phi i64 [ 9218868437227405312, %_llgo_1 ], [ -4503599627370496, %_llgo_3 ] - %3 = call double @main.Float64frombits(i64 %2) + %3 = call double @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.Float64frombits"(i64 %2) ret double %3 _llgo_3: ; preds = %_llgo_0 br label %_llgo_2 } -define i1 @main.IsNaN(double %0) { +define i1 @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.IsNaN"(double %0) { _llgo_0: %1 = fcmp une double %0, %0 ret i1 %1 } -define double @main.NaN() { +define double @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.NaN"() { _llgo_0: - %0 = call double @main.Float64frombits(i64 9221120237041090561) + %0 = call double @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.Float64frombits"(i64 9221120237041090561) ret double %0 } -define void @main.demo() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.demo"() { _llgo_0: ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.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 - call void @"main.init$after"() - store i64 9223372036854775807, ptr @main.a, align 4 - store i64 -9223372036854775808, ptr @main.b, align 4 - store i64 -1, ptr @main.n, align 4 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.init$after"() + store i64 9223372036854775807, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.a", align 4 + store i64 -9223372036854775808, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.b", align 4 + store i64 -1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.n", align 4 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %3 = getelementptr inbounds i64, ptr %2, i64 0 - store i64 1, ptr %3, align 4 - %4 = getelementptr inbounds i64, ptr %2, i64 1 - store i64 2, ptr %4, align 4 - %5 = getelementptr inbounds i64, ptr %2, i64 2 - store i64 3, ptr %5, align 4 - %6 = getelementptr inbounds i64, ptr %2, i64 3 - store i64 4, ptr %6, align 4 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 4, 1 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 4, 2 - %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %11 = getelementptr inbounds i64, ptr %10, i64 0 - %12 = getelementptr inbounds i64, ptr %10, i64 1 - %13 = getelementptr inbounds i64, ptr %10, i64 2 - %14 = getelementptr inbounds i64, ptr %10, i64 3 - store i64 1, ptr %11, align 4 - store i64 2, ptr %12, align 4 - store i64 3, ptr %13, align 4 - store i64 4, ptr %14, align 4 - %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 10) - %16 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %15, i64 1, i64 10, i64 0, i64 4, i64 10) - %17 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 1 - %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 2 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %1 = getelementptr inbounds i64, ptr %0, i64 0 + store i64 1, ptr %1, align 4 + %2 = getelementptr inbounds i64, ptr %0, i64 1 + store i64 2, ptr %2, align 4 + %3 = getelementptr inbounds i64, ptr %0, i64 2 + store i64 3, ptr %3, align 4 + %4 = getelementptr inbounds i64, ptr %0, i64 3 + store i64 4, ptr %4, align 4 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %5, i64 4, 1 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, i64 4, 2 + %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %9 = getelementptr inbounds i64, ptr %8, i64 0 + %10 = getelementptr inbounds i64, ptr %8, i64 1 + %11 = getelementptr inbounds i64, ptr %8, i64 2 + %12 = getelementptr inbounds i64, ptr %8, i64 3 + store i64 1, ptr %9, align 4 + store i64 2, ptr %10, align 4 + store i64 3, ptr %11, align 4 + store i64 4, ptr %12, align 4 + %13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 10) + %14 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %13, i64 1, i64 10, i64 0, i64 4, i64 10) + %15 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 1 + %16 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 2 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %15) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %16) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) + %17 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %14, 1 + %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %14, 2 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %14) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %17) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %18) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %19 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16, 1 - %20 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16, 2 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %19) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %20) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 4) @@ -132,73 +126,75 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %22 = getelementptr inbounds i64, ptr %21, i64 0 - store i64 1, ptr %22, align 4 - %23 = getelementptr inbounds i64, ptr %21, i64 1 - store i64 2, ptr %23, align 4 - %24 = getelementptr inbounds i64, ptr %21, i64 2 - store i64 3, ptr %24, align 4 - %25 = getelementptr inbounds i64, ptr %21, i64 3 - store i64 4, ptr %25, align 4 - %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %21, 0 - %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %26, i64 4, 1 - %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27, i64 4, 2 - %29 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %29) + %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %20 = getelementptr inbounds i64, ptr %19, i64 0 + store i64 1, ptr %20, align 4 + %21 = getelementptr inbounds i64, ptr %19, i64 1 + store i64 2, ptr %21, align 4 + %22 = getelementptr inbounds i64, ptr %19, i64 2 + store i64 3, ptr %22, align 4 + %23 = getelementptr inbounds i64, ptr %19, i64 3 + store i64 4, ptr %23, align 4 + %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %19, 0 + %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %24, i64 4, 1 + %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %25, i64 4, 2 + %27 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %26, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %27) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %30 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 2 - %31 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 1 - %32 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 0 - %33 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %32, i64 8, i64 %30, i64 1, i64 %31, i64 %30) - %34 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %33, 1 - %35 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 2 - %36 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 1 - %37 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 0 - %38 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %37, i64 8, i64 %35, i64 1, i64 %36, i64 %35) - %39 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38, 2 - %40 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 2 - %41 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 0 - %42 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %41, i64 8, i64 %40, i64 1, i64 2, i64 %40) - %43 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %42, 1 - %44 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 2 - %45 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 0 - %46 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %45, i64 8, i64 %44, i64 1, i64 2, i64 %44) - %47 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %46, 2 - %48 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 2 - %49 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 0 - %50 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %49, i64 8, i64 %48, i64 1, i64 2, i64 2) - %51 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %50, 1 - %52 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 2 - %53 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 0 - %54 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %53, i64 8, i64 %52, i64 1, i64 2, i64 2) - %55 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %54, 2 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %34) + %28 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 2 + %29 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 1 + %30 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 0 + %31 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %30, i64 8, i64 %28, i64 1, i64 %29, i64 %28) + %32 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31, 1 + %33 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 2 + %34 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 1 + %35 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 0 + %36 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %35, i64 8, i64 %33, i64 1, i64 %34, i64 %33) + %37 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36, 2 + %38 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 2 + %39 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 0 + %40 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %39, i64 8, i64 %38, i64 1, i64 2, i64 %38) + %41 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40, 1 + %42 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 2 + %43 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 0 + %44 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %43, i64 8, i64 %42, i64 1, i64 2, i64 %42) + %45 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %44, 2 + %46 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 2 + %47 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 0 + %48 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %47, i64 8, i64 %46, i64 1, i64 2, i64 2) + %49 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %48, 1 + %50 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 2 + %51 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 0 + %52 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %51, i64 8, i64 %50, i64 1, i64 2, i64 2) + %53 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %52, 2 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %39) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %37) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %43) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %41) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %47) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %45) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %51) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %49) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %53) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) + %54 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %8, i64 8, i64 4, i64 1, i64 4, i64 4) + %55 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %54, 1 + %56 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %8, i64 8, i64 4, i64 1, i64 4, i64 4) + %57 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %56, 2 + %58 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %8, i64 8, i64 4, i64 1, i64 2, i64 4) + %59 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, 1 + %60 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %8, i64 8, i64 4, i64 1, i64 2, i64 4) + %61 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, 2 + %62 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %8, i64 8, i64 4, i64 1, i64 2, i64 2) + %63 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %62, 1 + %64 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %8, i64 8, i64 4, i64 1, i64 2, i64 2) + %65 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %64, 2 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %55) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %56 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %10, i64 8, i64 4, i64 1, i64 4, i64 4) - %57 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %56, 1 - %58 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %10, i64 8, i64 4, i64 1, i64 4, i64 4) - %59 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, 2 - %60 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %10, i64 8, i64 4, i64 1, i64 2, i64 4) - %61 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, 1 - %62 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %10, i64 8, i64 4, i64 1, i64 2, i64 4) - %63 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %62, 2 - %64 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %10, i64 8, i64 4, i64 1, i64 2, i64 2) - %65 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %64, 1 - %66 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %10, i64 8, i64 4, i64 1, i64 2, i64 2) - %67 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %66, 2 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %57) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %59) @@ -208,58 +204,56 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %63) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %65) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %67) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %68 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, i64 1, i64 5) - %69 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, i64 1, i64 2) - %70 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, i64 5, i64 5) - %71 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %70, 1 + %66 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, i64 1, i64 5) + %67 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, i64 1, i64 2) + %68 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, i64 5, i64 5) + %69 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %68, 1 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %68) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %66) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %69) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %67) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %71) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %69) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %72 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %73 = getelementptr inbounds i64, ptr %72, i64 0 - store i64 5, ptr %73, align 4 - %74 = getelementptr inbounds i64, ptr %72, i64 1 - store i64 6, ptr %74, align 4 - %75 = getelementptr inbounds i64, ptr %72, i64 2 - store i64 7, ptr %75, align 4 - %76 = getelementptr inbounds i64, ptr %72, i64 3 - store i64 8, ptr %76, align 4 - %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %72, 0 - %78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77, i64 4, 1 - %79 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %78, i64 4, 2 - %80 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %79, 0 - %81 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %79, 1 - %82 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.SliceAppend"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, ptr %80, i64 %81, i64 8) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %82) + %70 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %71 = getelementptr inbounds i64, ptr %70, i64 0 + store i64 5, ptr %71, align 4 + %72 = getelementptr inbounds i64, ptr %70, i64 1 + store i64 6, ptr %72, align 4 + %73 = getelementptr inbounds i64, ptr %70, i64 2 + store i64 7, ptr %73, align 4 + %74 = getelementptr inbounds i64, ptr %70, i64 3 + store i64 8, ptr %74, align 4 + %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %70, 0 + %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75, i64 4, 1 + %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76, i64 4, 2 + %78 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77, 0 + %79 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77, 1 + %80 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.SliceAppend"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, ptr %78, i64 %79, i64 8) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %80) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %83 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 3) - %84 = getelementptr inbounds i8, ptr %83, i64 0 - store i8 97, ptr %84, align 1 - %85 = getelementptr inbounds i8, ptr %83, i64 1 - store i8 98, ptr %85, align 1 - %86 = getelementptr inbounds i8, ptr %83, i64 2 - store i8 99, ptr %86, align 1 - %87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %83, 0 - %88 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %87, i64 3, 1 - %89 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %88, i64 3, 2 - %90 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.SliceAppend"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %89, ptr @1, i64 3, i64 1) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %90) + %81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 3) + %82 = getelementptr inbounds i8, ptr %81, i64 0 + store i8 97, ptr %82, align 1 + %83 = getelementptr inbounds i8, ptr %81, i64 1 + store i8 98, ptr %83, align 1 + %84 = getelementptr inbounds i8, ptr %81, i64 2 + store i8 99, ptr %84, align 1 + %85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %81, 0 + %86 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %85, i64 3, 1 + %87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %86, i64 3, 2 + %88 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.SliceAppend"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %87, ptr @1, i64 3, i64 1) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %88) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %91 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %92 = load ptr, ptr @_llgo_int, align 8 - %93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %92, 0 - %94 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %93, ptr inttoptr (i64 100 to ptr), 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %94, ptr %91, align 8 - %95 = load %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %91, align 8 - %96 = ptrtoint ptr %91 to i64 + %89 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + %90 = load ptr, ptr @_llgo_int, align 8 + %91 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %90, 0 + %92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %91, ptr inttoptr (i64 100 to ptr), 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %92, ptr %89, align 8 + %93 = load %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %89, align 8 + %94 = ptrtoint ptr %89 to i64 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 true) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 0) @@ -276,174 +270,174 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double 1.005000e+02) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintEface"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %95) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintEface"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %93) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %91) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %89) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %96) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %94) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %97 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 3) - %98 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %99 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %97, 0 - %100 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %99, i64 3, 1 - %101 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %100, i64 3, 2 - %102 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %90, 0 - %103 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %90, 1 - %104 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.SliceCopy"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %101, ptr %102, i64 %103, i64 1) - store i64 %104, ptr %98, align 4 - %105 = load i64, ptr %98, align 4 - %106 = getelementptr inbounds i8, ptr %97, i64 0 + %95 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 3) + %96 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + %97 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %95, 0 + %98 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %97, i64 3, 1 + %99 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %98, i64 3, 2 + %100 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %88, 0 + %101 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %88, 1 + %102 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.SliceCopy"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %99, ptr %100, i64 %101, i64 1) + store i64 %102, ptr %96, align 4 + %103 = load i64, ptr %96, align 4 + %104 = getelementptr inbounds i8, ptr %95, i64 0 + %105 = load i8, ptr %104, align 1 + %106 = getelementptr inbounds i8, ptr %95, i64 1 %107 = load i8, ptr %106, align 1 - %108 = getelementptr inbounds i8, ptr %97, i64 1 + %108 = getelementptr inbounds i8, ptr %95, i64 2 %109 = load i8, ptr %108, align 1 - %110 = getelementptr inbounds i8, ptr %97, i64 2 - %111 = load i8, ptr %110, align 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %105) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %103) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %112 = zext i8 %107 to i64 + %110 = zext i8 %105 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %110) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + %111 = zext i8 %107 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %111) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + %112 = zext i8 %109 to i64 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %112) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %113 = zext i8 %109 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %113) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %114 = zext i8 %111 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %114) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %115 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %97, i64 1, i64 3, i64 1, i64 3, i64 3) - %116 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.SliceCopy"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %115, ptr @2, i64 4, i64 1) - store i64 %116, ptr %98, align 4 - %117 = load i64, ptr %98, align 4 - %118 = getelementptr inbounds i8, ptr %97, i64 0 + %113 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr %95, i64 1, i64 3, i64 1, i64 3, i64 3) + %114 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.SliceCopy"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %113, ptr @2, i64 4, i64 1) + store i64 %114, ptr %96, align 4 + %115 = load i64, ptr %96, align 4 + %116 = getelementptr inbounds i8, ptr %95, i64 0 + %117 = load i8, ptr %116, align 1 + %118 = getelementptr inbounds i8, ptr %95, i64 1 %119 = load i8, ptr %118, align 1 - %120 = getelementptr inbounds i8, ptr %97, i64 1 + %120 = getelementptr inbounds i8, ptr %95, i64 2 %121 = load i8, ptr %120, align 1 - %122 = getelementptr inbounds i8, ptr %97, i64 2 - %123 = load i8, ptr %122, align 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %117) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %115) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %124 = zext i8 %119 to i64 + %122 = zext i8 %117 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %122) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + %123 = zext i8 %119 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %123) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + %124 = zext i8 %121 to i64 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %124) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %125 = zext i8 %121 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %125) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %126 = zext i8 %123 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %126) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %127 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %128 = getelementptr inbounds { ptr }, ptr %127, i32 0, i32 0 - store ptr %98, ptr %128, align 8 - %129 = insertvalue { ptr, ptr } { ptr @"main.main$2", ptr undef }, ptr %127, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr @main.demo) + %125 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %126 = getelementptr inbounds { ptr }, ptr %125, i32 0, i32 0 + store ptr %96, ptr %126, align 8 + %127 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.main$2", ptr undef }, ptr %125, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.demo") call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr @main.demo) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.demo") call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr @"main.main$1") + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.main$1") call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %130 = extractvalue { ptr, ptr } %129, 0 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %130) + %128 = extractvalue { ptr, ptr } %127, 0 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %128) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %131 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewStringIter"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 7 }) + %129 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewStringIter"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 7 }) br label %_llgo_1 _llgo_1: ; preds = %_llgo_2, %_llgo_0 - %132 = call { i1, i64, i32 } @"github.com/goplus/llgo/runtime/internal/runtime.StringIterNext"(ptr %131) - %133 = extractvalue { i1, i64, i32 } %132, 0 - br i1 %133, label %_llgo_2, label %_llgo_3 + %130 = call { i1, i64, i32 } @"github.com/goplus/llgo/runtime/internal/runtime.StringIterNext"(ptr %129) + %131 = extractvalue { i1, i64, i32 } %130, 0 + br i1 %131, label %_llgo_2, label %_llgo_3 _llgo_2: ; preds = %_llgo_1 - %134 = extractvalue { i1, i64, i32 } %132, 1 - %135 = extractvalue { i1, i64, i32 } %132, 2 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %134) + %132 = extractvalue { i1, i64, i32 } %130, 1 + %133 = extractvalue { i1, i64, i32 } %130, 2 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %132) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - %136 = sext i32 %135 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %136) + %134 = sext i32 %133 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %134) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) br label %_llgo_1 _llgo_3: ; preds = %_llgo_1 - %137 = call double @main.Inf(i64 1) - %138 = call double @main.Inf(i64 -1) - %139 = call double @main.NaN() - %140 = call double @main.NaN() - %141 = call i1 @main.IsNaN(double %140) - %142 = call i1 @main.IsNaN(double 1.000000e+00) + %135 = call double @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.Inf"(i64 1) + %136 = call double @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.Inf"(i64 -1) + %137 = call double @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.NaN"() + %138 = call double @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.NaN"() + %139 = call i1 @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.IsNaN"(double %138) + %140 = call i1 @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.IsNaN"(double 1.000000e+00) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %135) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %136) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %137) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %138) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %139) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double %139) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %141) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %142) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %140) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %143 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 7 }) - %144 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToRunes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 7 }) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %143) + %141 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 7 }) + %142 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.StringToRunes"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 7 }) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %141) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %144) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %142) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %145 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %143) - %146 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRunes"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %144) - %147 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %143, 0 - %148 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %143, 1 - %149 = icmp sge i64 3, %148 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %149) - %150 = getelementptr inbounds i8, ptr %147, i64 3 - %151 = load i8, ptr %150, align 1 - %152 = sext i8 %151 to i32 - %153 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRune"(i32 %152) - %154 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %144, 0 - %155 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %144, 1 - %156 = icmp sge i64 0, %155 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %156) - %157 = getelementptr inbounds i32, ptr %154, i64 0 - %158 = load i32, ptr %157, align 4 - %159 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRune"(i32 %158) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %145) + %143 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromBytes"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %141) + %144 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRunes"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %142) + %145 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %141, 0 + %146 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %141, 1 + %147 = icmp sge i64 3, %146 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %147) + %148 = getelementptr inbounds i8, ptr %145, i64 3 + %149 = load i8, ptr %148, align 1 + %150 = sext i8 %149 to i32 + %151 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRune"(i32 %150) + %152 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %142, 0 + %153 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %142, 1 + %154 = icmp sge i64 0, %153 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %154) + %155 = getelementptr inbounds i32, ptr %152, i64 0 + %156 = load i32, ptr %155, align 4 + %157 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRune"(i32 %156) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %143) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %146) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %144) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %153) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %151) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %159) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %157) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %160 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }) - %161 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }) - %162 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }) - %163 = xor i1 %162, true - %164 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringLess"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }) + %158 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }) + %159 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }) + %160 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }) + %161 = xor i1 %160, true + %162 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringLess"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }) + %163 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringLess"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }) + %164 = xor i1 %163, true %165 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringLess"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }) - %166 = xor i1 %165, true - %167 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringLess"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }) - %168 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringLess"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }) - %169 = xor i1 %168, true - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %160) + %166 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringLess"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 3 }) + %167 = xor i1 %166, true + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %158) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %159) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %161) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %163) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %162) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %164) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %166) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %165) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %167) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %169) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -define void @"main.main$1"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.main$1"() { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 2 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) ret void } -define void @"main.main$2"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.main$2"(ptr %0) { _llgo_0: %1 = load { ptr }, ptr %0, align 8 %2 = extractvalue { ptr } %1, 0 @@ -455,8 +449,6 @@ _llgo_0: declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr, i64, i64, i64, i64, i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintSlice"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice") @@ -471,7 +463,7 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"gi declare %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.SliceAppend"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr, i64, i64) -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/builtin.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = icmp eq ptr %0, null diff --git a/compiler/cl/_testrt/callback/out.ll b/compiler/cl/_testrt/callback/out.ll index 0838679f..678de34b 100644 --- a/compiler/cl/_testrt/callback/out.ll +++ b/compiler/cl/_testrt/callback/out.ll @@ -1,13 +1,11 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/callback' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/callback" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/callback.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [7 x i8] c"Hello\0A\00", align 1 @1 = private unnamed_addr constant [10 x i8] c"callback\0A\00", align 1 -define void @main.callback(ptr %0, { ptr, ptr } %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/callback.callback"(ptr %0, { ptr, ptr } %1) { _llgo_0: %2 = extractvalue { ptr, ptr } %1, 1 %3 = extractvalue { ptr, ptr } %1, 0 @@ -15,41 +13,35 @@ _llgo_0: ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/callback.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/callback.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/callback.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/callback.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.callback(ptr @0, { ptr, ptr } { ptr @__llgo_stub.main.print, ptr null }) - call void @main.callback(ptr @1, { ptr, ptr } { ptr @__llgo_stub.main.print, ptr null }) - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/callback.callback"(ptr @0, { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/callback.print", ptr null }) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/callback.callback"(ptr @1, { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/callback.print", ptr null }) + ret void } -define void @main.print(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/callback.print"(ptr %0) { _llgo_0: %1 = call i32 (ptr, ...) @printf(ptr %0) ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define linkonce void @__llgo_stub.main.print(ptr %0, ptr %1) { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/callback.print"(ptr %0, ptr %1) { _llgo_0: - tail call void @main.print(ptr %1) + tail call void @"github.com/goplus/llgo/compiler/cl/_testrt/callback.print"(ptr %1) ret void } diff --git a/compiler/cl/_testrt/cast/out.ll b/compiler/cl/_testrt/cast/out.ll index e8ae001f..9608b177 100644 --- a/compiler/cl/_testrt/cast/out.ll +++ b/compiler/cl/_testrt/cast/out.ll @@ -1,16 +1,14 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/cast' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/cast" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/cast.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [5 x i8] c"error", align 1 @_llgo_string = linkonce global ptr null, align 8 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -define void @main.cvt32Fto32(float %0, i32 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32"(float %0, i32 %1) { _llgo_0: %2 = fptosi float %0 to i32 %3 = icmp ne i32 %2, %1 @@ -29,7 +27,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt32Fto32U(float %0, i32 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32U"(float %0, i32 %1) { _llgo_0: %2 = fptoui float %0 to i32 %3 = icmp ne i32 %2, %1 @@ -48,7 +46,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt32Fto64F(float %0, double %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto64F"(float %0, double %1) { _llgo_0: %2 = fpext float %0 to double %3 = fcmp une double %2, %1 @@ -67,7 +65,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt32Fto8(float %0, i8 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8"(float %0, i8 %1) { _llgo_0: %2 = fptosi float %0 to i8 %3 = icmp ne i8 %2, %1 @@ -86,7 +84,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt32Fto8U(float %0, i8 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8U"(float %0, i8 %1) { _llgo_0: %2 = fptoui float %0 to i8 %3 = icmp ne i8 %2, %1 @@ -105,7 +103,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt32to64(i32 %0, i64 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32to64"(i32 %0, i64 %1) { _llgo_0: %2 = sext i32 %0 to i64 %3 = icmp ne i64 %2, %1 @@ -124,7 +122,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt64Fto32F(double %0, float %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Fto32F"(double %0, float %1) { _llgo_0: %2 = fptrunc double %0 to float %3 = fcmp une float %2, %1 @@ -143,7 +141,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt64Uto64F(i64 %0, double %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Uto64F"(i64 %0, double %1) { _llgo_0: %2 = uitofp i64 %0 to double %3 = fcmp une double %2, %1 @@ -162,7 +160,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt64to64F(i64 %0, double %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to64F"(i64 %0, double %1) { _llgo_0: %2 = sitofp i64 %0 to double %3 = fcmp une double %2, %1 @@ -181,7 +179,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt64to8(i64 %0, i8 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8"(i64 %0, i8 %1) { _llgo_0: %2 = trunc i64 %0 to i8 %3 = icmp ne i8 %2, %1 @@ -200,7 +198,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvt64to8U(i64 %0, i8 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8U"(i64 %0, i8 %1) { _llgo_0: %2 = trunc i64 %0 to i8 %3 = icmp ne i8 %2, %1 @@ -219,7 +217,7 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @main.cvtUinptr(i32 %0, i64 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvtUinptr"(i32 %0, i64 %1) { _llgo_0: %2 = zext i32 %0 to i64 %3 = icmp ne i64 %2, %1 @@ -252,82 +250,78 @@ _llgo_4: ; preds = %_llgo_2 ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/cast.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/cast.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.cvt64to8(i64 0, i8 0) - call void @main.cvt64to8(i64 127, i8 127) - call void @main.cvt64to8(i64 128, i8 -128) - call void @main.cvt64to8(i64 -128, i8 -128) - call void @main.cvt64to8(i64 -129, i8 127) - call void @main.cvt64to8(i64 256, i8 0) - call void @main.cvt64to8U(i64 0, i8 0) - call void @main.cvt64to8U(i64 255, i8 -1) - call void @main.cvt64to8U(i64 256, i8 0) - call void @main.cvt64to8U(i64 257, i8 1) - call void @main.cvt64to8U(i64 -1, i8 -1) - call void @main.cvt32Fto8(float 0x3FB99999A0000000, i8 0) - call void @main.cvt32Fto8(float 0x405FC66660000000, i8 127) - call void @main.cvt32Fto8(float 0x4060033340000000, i8 -128) - call void @main.cvt32Fto8(float 0xC060033340000000, i8 -128) - call void @main.cvt32Fto8(float 0xC060233340000000, i8 127) - call void @main.cvt32Fto8(float 0x40700199A0000000, i8 0) - call void @main.cvt32Fto8U(float 0.000000e+00, i8 0) - call void @main.cvt32Fto8U(float 2.550000e+02, i8 -1) - call void @main.cvt32Fto8U(float 2.560000e+02, i8 0) - call void @main.cvt32Fto8U(float 2.570000e+02, i8 1) - call void @main.cvt32Fto8U(float -1.000000e+00, i8 -1) - call void @main.cvt32Fto32(float 0.000000e+00, i32 0) - call void @main.cvt32Fto32(float 1.500000e+00, i32 1) - call void @main.cvt32Fto32(float 0x41D1194D80000000, i32 1147483648) - call void @main.cvt32Fto32(float 0xC1E0000000000000, i32 -2147483648) - call void @main.cvt32Fto32U(float 0.000000e+00, i32 0) - call void @main.cvt32Fto32U(float 1.500000e+00, i32 1) - call void @main.cvt32Fto32U(float 0x41F0000000000000, i32 0) - call void @main.cvt32Fto32U(float 0x41F3B9ACA0000000, i32 1000000000) - call void @main.cvt32Fto32U(float 0xC1F0000000000000, i32 0) - call void @main.cvt32Fto32U(float 0xC1D34BE880000000, i32 -1294967296) - call void @main.cvt32Fto32U(float 0xBFF19999A0000000, i32 -1) - call void @main.cvt32Fto64F(float 0.000000e+00, double 0.000000e+00) - call void @main.cvt32Fto64F(float 1.500000e+00, double 1.500000e+00) - call void @main.cvt32Fto64F(float 1.000000e+10, double 1.000000e+10) - call void @main.cvt32Fto64F(float -1.000000e+10, double -1.000000e+10) - call void @main.cvt64Fto32F(double 0.000000e+00, float 0.000000e+00) - call void @main.cvt64Fto32F(double 1.500000e+00, float 1.500000e+00) - call void @main.cvt64Fto32F(double 1.000000e+10, float 1.000000e+10) - call void @main.cvt64Fto32F(double -1.000000e+10, float -1.000000e+10) - call void @main.cvt64to64F(i64 0, double 0.000000e+00) - call void @main.cvt64to64F(i64 10000000000, double 1.000000e+10) - call void @main.cvt64to64F(i64 9223372036854775807, double 0x43E0000000000000) - call void @main.cvt64to64F(i64 -9223372036854775807, double 0xC3E0000000000000) - call void @main.cvt64Uto64F(i64 0, double 0.000000e+00) - call void @main.cvt64Uto64F(i64 10000000000, double 1.000000e+10) - call void @main.cvt64Uto64F(i64 9223372036854775807, double 0x43E0000000000000) - call void @main.cvt64Uto64F(i64 -1, double 0x43F0000000000000) - call void @main.cvt32to64(i32 0, i64 0) - call void @main.cvt32to64(i32 2147483647, i64 2147483647) - call void @main.cvtUinptr(i32 1024, i64 1024) - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8"(i64 0, i8 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8"(i64 127, i8 127) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8"(i64 128, i8 -128) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8"(i64 -128, i8 -128) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8"(i64 -129, i8 127) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8"(i64 256, i8 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8U"(i64 0, i8 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8U"(i64 255, i8 -1) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8U"(i64 256, i8 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8U"(i64 257, i8 1) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to8U"(i64 -1, i8 -1) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8"(float 0x3FB99999A0000000, i8 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8"(float 0x405FC66660000000, i8 127) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8"(float 0x4060033340000000, i8 -128) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8"(float 0xC060033340000000, i8 -128) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8"(float 0xC060233340000000, i8 127) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8"(float 0x40700199A0000000, i8 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8U"(float 0.000000e+00, i8 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8U"(float 2.550000e+02, i8 -1) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8U"(float 2.560000e+02, i8 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8U"(float 2.570000e+02, i8 1) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto8U"(float -1.000000e+00, i8 -1) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32"(float 0.000000e+00, i32 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32"(float 1.500000e+00, i32 1) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32"(float 0x41D1194D80000000, i32 1147483648) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32"(float 0xC1E0000000000000, i32 -2147483648) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32U"(float 0.000000e+00, i32 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32U"(float 1.500000e+00, i32 1) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32U"(float 0x41F0000000000000, i32 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32U"(float 0x41F3B9ACA0000000, i32 1000000000) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32U"(float 0xC1F0000000000000, i32 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32U"(float 0xC1D34BE880000000, i32 -1294967296) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto32U"(float 0xBFF19999A0000000, i32 -1) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto64F"(float 0.000000e+00, double 0.000000e+00) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto64F"(float 1.500000e+00, double 1.500000e+00) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto64F"(float 1.000000e+10, double 1.000000e+10) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32Fto64F"(float -1.000000e+10, double -1.000000e+10) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Fto32F"(double 0.000000e+00, float 0.000000e+00) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Fto32F"(double 1.500000e+00, float 1.500000e+00) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Fto32F"(double 1.000000e+10, float 1.000000e+10) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Fto32F"(double -1.000000e+10, float -1.000000e+10) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to64F"(i64 0, double 0.000000e+00) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to64F"(i64 10000000000, double 1.000000e+10) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to64F"(i64 9223372036854775807, double 0x43E0000000000000) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64to64F"(i64 -9223372036854775807, double 0xC3E0000000000000) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Uto64F"(i64 0, double 0.000000e+00) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Uto64F"(i64 10000000000, double 1.000000e+10) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Uto64F"(i64 9223372036854775807, double 0x43E0000000000000) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt64Uto64F"(i64 -1, double 0x43F0000000000000) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32to64"(i32 0, i64 0) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvt32to64"(i32 2147483647, i64 2147483647) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.cvtUinptr"(i32 1024, i64 1024) + ret void } -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cast.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_string, align 8 %1 = icmp eq ptr %0, null @@ -347,5 +341,3 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testrt/closure/out.ll b/compiler/cl/_testrt/closure/out.ll index ca7a5630..47b725b0 100644 --- a/compiler/cl/_testrt/closure/out.ll +++ b/compiler/cl/_testrt/closure/out.ll @@ -1,57 +1,51 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/closure' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/closure" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/closure.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 @1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closure.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closure.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closure.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closure.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @"main.main$1"(i64 100, i64 200) - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - store { ptr, ptr } { ptr @"__llgo_stub.main.main$2", ptr null }, ptr %2, align 8 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %4 = getelementptr inbounds { ptr }, ptr %3, i32 0, i32 0 - store ptr %2, ptr %4, align 8 - %5 = insertvalue { ptr, ptr } { ptr @"main.main$3", ptr undef }, ptr %3, 1 - %6 = extractvalue { ptr, ptr } %5, 1 - %7 = extractvalue { ptr, ptr } %5, 0 - call void %7(ptr %6) - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/closure.main$1"(i64 100, i64 200) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + store { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/closure.main$2", ptr null }, ptr %0, align 8 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %2 = getelementptr inbounds { ptr }, ptr %1, i32 0, i32 0 + store ptr %0, ptr %2, align 8 + %3 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closure.main$3", ptr undef }, ptr %1, 1 + %4 = extractvalue { ptr, ptr } %3, 1 + %5 = extractvalue { ptr, ptr } %3, 0 + call void %5(ptr %4) + ret void } -define void @"main.main$1"(i64 %0, i64 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closure.main$1"(i64 %0, i64 %1) { _llgo_0: %2 = call i32 (ptr, ...) @printf(ptr @0, i64 %0, i64 %1) ret void } -define void @"main.main$2"(i64 %0, i64 %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closure.main$2"(i64 %0, i64 %1) { _llgo_0: %2 = call i32 (ptr, ...) @printf(ptr @1, i64 %0, i64 %1) ret void } -define void @"main.main$3"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closure.main$3"(ptr %0) { _llgo_0: %1 = load { ptr }, ptr %0, align 8 %2 = extractvalue { ptr } %1, 0 @@ -62,13 +56,11 @@ _llgo_0: ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define linkonce void @"__llgo_stub.main.main$2"(ptr %0, i64 %1, i64 %2) { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/closure.main$2"(ptr %0, i64 %1, i64 %2) { _llgo_0: - tail call void @"main.main$2"(i64 %1, i64 %2) + tail call void @"github.com/goplus/llgo/compiler/cl/_testrt/closure.main$2"(i64 %1, i64 %2) ret void } diff --git a/compiler/cl/_testrt/closureconv/out.ll b/compiler/cl/_testrt/closureconv/out.ll index 90b316cb..03ddbd83 100644 --- a/compiler/cl/_testrt/closureconv/out.ll +++ b/compiler/cl/_testrt/closureconv/out.ll @@ -1,91 +1,89 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/closureconv' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/closureconv" -%main.Call = type { %main.Func, i64 } -%main.Func = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Call" = type { %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func", i64 } +%"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.init$guard" = global i1 false, align 1 -define i64 @"main.(*Call).add"(ptr %0, i64 %1, i64 %2) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.(*Call).add"(ptr %0, i64 %1, i64 %2) { _llgo_0: %3 = add i64 %1, %2 - %4 = getelementptr inbounds %main.Call, ptr %0, i32 0, i32 1 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Call", ptr %0, i32 0, i32 1 %5 = load i64, ptr %4, align 4 %6 = add i64 %3, %5 ret i64 %6 } -define i64 @main.add(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.add"(i64 %0, i64 %1) { _llgo_0: %2 = add i64 %0, %1 ret i64 %2 } -define %main.Func @main.demo1(i64 %0) { +define %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo1"(i64 %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %2 = getelementptr inbounds %main.Call, ptr %1, i32 0, i32 1 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Call", ptr %1, i32 0, i32 1 store i64 %0, ptr %2, align 4 %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %4 = getelementptr inbounds { ptr }, ptr %3, i32 0, i32 0 store ptr %1, ptr %4, align 8 - %5 = insertvalue { ptr, ptr } { ptr @"main.add$bound", ptr undef }, ptr %3, 1 - %6 = getelementptr inbounds %main.Call, ptr %1, i32 0, i32 0 - %7 = alloca %main.Func, align 8 + %5 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.add$bound", ptr undef }, ptr %3, 1 + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Call", ptr %1, i32 0, i32 0 + %7 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func", align 8 store { ptr, ptr } %5, ptr %7, align 8 - %8 = load %main.Func, ptr %7, align 8 - store %main.Func %8, ptr %6, align 8 - %9 = getelementptr inbounds %main.Call, ptr %1, i32 0, i32 0 - %10 = load %main.Func, ptr %9, align 8 - ret %main.Func %10 + %8 = load %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func", ptr %7, align 8 + store %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %8, ptr %6, align 8 + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Call", ptr %1, i32 0, i32 0 + %10 = load %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func", ptr %9, align 8 + ret %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %10 } -define %main.Func @main.demo2() { +define %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo2"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %2 = getelementptr inbounds { ptr }, ptr %1, i32 0, i32 0 store ptr %0, ptr %2, align 8 - %3 = insertvalue { ptr, ptr } { ptr @"main.add$bound", ptr undef }, ptr %1, 1 - %4 = alloca %main.Func, align 8 + %3 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.add$bound", ptr undef }, ptr %1, 1 + %4 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func", align 8 store { ptr, ptr } %3, ptr %4, align 8 - %5 = load %main.Func, ptr %4, align 8 - ret %main.Func %5 + %5 = load %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func", ptr %4, align 8 + ret %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %5 } -define %main.Func @main.demo3() { +define %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo3"() { _llgo_0: - ret %main.Func { ptr @__llgo_stub.main.add, ptr null } + ret %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/closureconv.add", ptr null } } -define %main.Func @main.demo4() { +define %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo4"() { _llgo_0: - ret %main.Func { ptr @"__llgo_stub.main.demo4$1", ptr null } + ret %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo4$1", ptr null } } -define i64 @"main.demo4$1"(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo4$1"(i64 %0, i64 %1) { _llgo_0: %2 = add i64 %0, %1 ret i64 %2 } -define %main.Func @main.demo5(i64 %0) { +define %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo5"(i64 %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) store i64 %0, ptr %1, align 4 %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %3 = getelementptr inbounds { ptr }, ptr %2, i32 0, i32 0 store ptr %1, ptr %3, align 8 - %4 = insertvalue { ptr, ptr } { ptr @"main.demo5$1", ptr undef }, ptr %2, 1 - %5 = alloca %main.Func, align 8 + %4 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo5$1", ptr undef }, ptr %2, 1 + %5 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func", align 8 store { ptr, ptr } %4, ptr %5, align 8 - %6 = load %main.Func, ptr %5, align 8 - ret %main.Func %6 + %6 = load %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func", ptr %5, align 8 + ret %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %6 } -define i64 @"main.demo5$1"(ptr %0, i64 %1, i64 %2) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo5$1"(ptr %0, i64 %1, i64 %2) { _llgo_0: %3 = add i64 %1, %2 %4 = load { ptr }, ptr %0, align 8 @@ -95,99 +93,93 @@ _llgo_0: ret i64 %7 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call %main.Func @main.demo1(i64 1) - %3 = extractvalue %main.Func %2, 1 - %4 = extractvalue %main.Func %2, 0 - %5 = call i64 %4(ptr %3, i64 99, i64 200) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %5) + %0 = call %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo1"(i64 1) + %1 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %0, 1 + %2 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %0, 0 + %3 = call i64 %2(ptr %1, i64 99, i64 200) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %3) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %6 = call %main.Func @main.demo2() - %7 = extractvalue %main.Func %6, 1 - %8 = extractvalue %main.Func %6, 0 - %9 = call i64 %8(ptr %7, i64 100, i64 200) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %9) + %4 = call %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo2"() + %5 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %4, 1 + %6 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %4, 0 + %7 = call i64 %6(ptr %5, i64 100, i64 200) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %7) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %10 = call %main.Func @main.demo3() - %11 = extractvalue %main.Func %10, 1 - %12 = extractvalue %main.Func %10, 0 - %13 = call i64 %12(ptr %11, i64 100, i64 200) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %13) + %8 = call %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo3"() + %9 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %8, 1 + %10 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %8, 0 + %11 = call i64 %10(ptr %9, i64 100, i64 200) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %11) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %14 = call %main.Func @main.demo4() - %15 = extractvalue %main.Func %14, 1 - %16 = extractvalue %main.Func %14, 0 - %17 = call i64 %16(ptr %15, i64 100, i64 200) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %17) + %12 = call %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo4"() + %13 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %12, 1 + %14 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %12, 0 + %15 = call i64 %14(ptr %13, i64 100, i64 200) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %15) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %18 = call %main.Func @main.demo5(i64 1) - %19 = extractvalue %main.Func %18, 1 - %20 = extractvalue %main.Func %18, 0 - %21 = call i64 %20(ptr %19, i64 99, i64 200) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %21) + %16 = call %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo5"(i64 1) + %17 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %16, 1 + %18 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %16, 0 + %19 = call i64 %18(ptr %17, i64 99, i64 200) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %19) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %22 = call %main.Func @main.demo5(i64 1) - %23 = alloca { ptr, ptr }, align 8 - store %main.Func %22, ptr %23, align 8 - %24 = load { ptr, ptr }, ptr %23, align 8 - %25 = extractvalue { ptr, ptr } %24, 1 - %26 = extractvalue { ptr, ptr } %24, 0 - %27 = call i64 %26(ptr %25, i64 99, i64 200) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %27) + %20 = call %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo5"(i64 1) + %21 = alloca { ptr, ptr }, align 8 + store %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %20, ptr %21, align 8 + %22 = load { ptr, ptr }, ptr %21, align 8 + %23 = extractvalue { ptr, ptr } %22, 1 + %24 = extractvalue { ptr, ptr } %22, 0 + %25 = call i64 %24(ptr %23, i64 99, i64 200) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %25) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %28 = call %main.Func @main.demo5(i64 1) - %29 = extractvalue %main.Func %28, 1 - %30 = extractvalue %main.Func %28, 0 - %31 = call i64 %30(ptr %29, i64 99, i64 200) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %31) + %26 = call %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo5"(i64 1) + %27 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %26, 1 + %28 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.Func" %26, 0 + %29 = call i64 %28(ptr %27, i64 99, i64 200) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %29) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define i64 @"main.add$bound"(ptr %0, i64 %1, i64 %2) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.add$bound"(ptr %0, i64 %1, i64 %2) { _llgo_0: %3 = load { ptr }, ptr %0, align 8 %4 = extractvalue { ptr } %3, 0 - %5 = call i64 @"main.(*Call).add"(ptr %4, i64 %1, i64 %2) + %5 = call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.(*Call).add"(ptr %4, i64 %1, i64 %2) ret i64 %5 } declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) -define linkonce i64 @__llgo_stub.main.add(ptr %0, i64 %1, i64 %2) { +define linkonce i64 @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/closureconv.add"(ptr %0, i64 %1, i64 %2) { _llgo_0: - %3 = tail call i64 @main.add(i64 %1, i64 %2) + %3 = tail call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.add"(i64 %1, i64 %2) ret i64 %3 } -define linkonce i64 @"__llgo_stub.main.demo4$1"(ptr %0, i64 %1, i64 %2) { +define linkonce i64 @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo4$1"(ptr %0, i64 %1, i64 %2) { _llgo_0: - %3 = tail call i64 @"main.demo4$1"(i64 %1, i64 %2) + %3 = tail call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/closureconv.demo4$1"(i64 %1, i64 %2) ret i64 %3 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testrt/closureiface/out.ll b/compiler/cl/_testrt/closureiface/out.ll index bfcfb478..1df983af 100644 --- a/compiler/cl/_testrt/closureiface/out.ll +++ b/compiler/cl/_testrt/closureiface/out.ll @@ -1,98 +1,92 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/closureiface' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/closureiface" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.init$guard" = global i1 false, align 1 @_llgo_int = linkonce global ptr null, align 8 @"_llgo_func$ekGNsrYBSzltfAjxbl6T8H6Yq8j16wzqS3nDj2xxGMU" = linkonce global ptr null, align 8 @_llgo_Pointer = linkonce global ptr null, align 8 -@"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk" = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [2 x i8] c"$f", align 1 @1 = private unnamed_addr constant [5 x i8] c"$data", align 1 -@2 = private unnamed_addr constant [4 x i8] c"main", align 1 +@2 = private unnamed_addr constant [55 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/closureiface", align 1 @3 = private unnamed_addr constant [5 x i8] c"error", align 1 @_llgo_string = linkonce global ptr null, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - store i64 200, ptr %2, align 4 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %4 = getelementptr inbounds { ptr }, ptr %3, i32 0, i32 0 - store ptr %2, ptr %4, align 8 - %5 = insertvalue { ptr, ptr } { ptr @"main.main$1", ptr undef }, ptr %3, 1 - %6 = load ptr, ptr @_llgo_int, align 8 - %7 = load ptr, ptr @"_llgo_func$ekGNsrYBSzltfAjxbl6T8H6Yq8j16wzqS3nDj2xxGMU", align 8 - %8 = load ptr, ptr @_llgo_Pointer, align 8 - %9 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 - %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store { ptr, ptr } %5, ptr %10, align 8 - %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %9, 0 - %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %11, ptr %10, 1 - %13 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %12, 0 - %14 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 - %15 = icmp eq ptr %13, %14 - br i1 %15, label %_llgo_3, label %_llgo_4 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + store i64 200, ptr %0, align 4 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %2 = getelementptr inbounds { ptr }, ptr %1, i32 0, i32 0 + store ptr %0, ptr %2, align 8 + %3 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.main$1", ptr undef }, ptr %1, 1 + %4 = load ptr, ptr @_llgo_int, align 8 + %5 = load ptr, ptr @"_llgo_func$ekGNsrYBSzltfAjxbl6T8H6Yq8j16wzqS3nDj2xxGMU", align 8 + %6 = load ptr, ptr @_llgo_Pointer, align 8 + %7 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store { ptr, ptr } %3, ptr %8, align 8 + %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %7, 0 + %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, ptr %8, 1 + %11 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, 0 + %12 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %13 = icmp eq ptr %11, %12 + br i1 %13, label %_llgo_3, label %_llgo_4 _llgo_1: ; preds = %_llgo_5 - %16 = load ptr, ptr @_llgo_string, align 8 - %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 5 }, ptr %17, align 8 - %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %16, 0 - %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %18, ptr %17, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %19) + %14 = load ptr, ptr @_llgo_string, align 8 + %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 5 }, ptr %15, align 8 + %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %14, 0 + %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %16, ptr %15, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %17) unreachable _llgo_2: ; preds = %_llgo_5 - %20 = extractvalue { ptr, ptr } %28, 1 - %21 = extractvalue { ptr, ptr } %28, 0 - %22 = call i64 %21(ptr %20, i64 100) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %22) + %18 = extractvalue { ptr, ptr } %26, 1 + %19 = extractvalue { ptr, ptr } %26, 0 + %20 = call i64 %19(ptr %18, i64 100) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %20) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void _llgo_3: ; preds = %_llgo_0 - %23 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %12, 1 - %24 = load { ptr, ptr }, ptr %23, align 8 - %25 = insertvalue { { ptr, ptr }, i1 } undef, { ptr, ptr } %24, 0 - %26 = insertvalue { { ptr, ptr }, i1 } %25, i1 true, 1 + %21 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, 1 + %22 = load { ptr, ptr }, ptr %21, align 8 + %23 = insertvalue { { ptr, ptr }, i1 } undef, { ptr, ptr } %22, 0 + %24 = insertvalue { { ptr, ptr }, i1 } %23, i1 true, 1 br label %_llgo_5 _llgo_4: ; preds = %_llgo_0 br label %_llgo_5 _llgo_5: ; preds = %_llgo_4, %_llgo_3 - %27 = phi { { ptr, ptr }, i1 } [ %26, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ] - %28 = extractvalue { { ptr, ptr }, i1 } %27, 0 - %29 = extractvalue { { ptr, ptr }, i1 } %27, 1 - br i1 %29, label %_llgo_2, label %_llgo_1 + %25 = phi { { ptr, ptr }, i1 } [ %24, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ] + %26 = extractvalue { { ptr, ptr }, i1 } %25, 0 + %27 = extractvalue { { ptr, ptr }, i1 } %25, 1 + br i1 %27, label %_llgo_2, label %_llgo_1 } -define i64 @"main.main$1"(ptr %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.main$1"(ptr %0, i64 %1) { _llgo_0: %2 = load { ptr }, ptr %0, align 8 %3 = extractvalue { ptr } %2, 0 @@ -101,13 +95,11 @@ _llgo_0: ret i64 %5 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = icmp eq ptr %0, null @@ -181,8 +173,8 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %37, 0 %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40, i64 2, 1 %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %41, i64 2, 2 - %43 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %42) - store ptr %43, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 + %43 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 55 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %42) + store ptr %43, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/closureiface.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8 %44 = load ptr, ptr @_llgo_string, align 8 %45 = icmp eq ptr %44, null br i1 %45, label %_llgo_7, label %_llgo_8 diff --git a/compiler/cl/_testrt/complex/out.ll b/compiler/cl/_testrt/complex/out.ll index f2a5d2f8..659c575b 100644 --- a/compiler/cl/_testrt/complex/out.ll +++ b/compiler/cl/_testrt/complex/out.ll @@ -1,29 +1,23 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/complex' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/complex" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/complex.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/complex.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/complex.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/complex.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/complex.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double 1.000000e+00) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double 2.000000e+00) @@ -52,11 +46,9 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 true) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testrt/concat/out.ll b/compiler/cl/_testrt/concat/out.ll index 9885d753..dbe8ff3c 100644 --- a/compiler/cl/_testrt/concat/out.ll +++ b/compiler/cl/_testrt/concat/out.ll @@ -1,18 +1,16 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/concat' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/concat" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/concat.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [3 x i8] c"...", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @1 = private unnamed_addr constant [5 x i8] c"Hello", align 1 @2 = private unnamed_addr constant [1 x i8] c" ", align 1 @3 = private unnamed_addr constant [5 x i8] c"World", align 1 -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @main.concat(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testrt/concat.concat"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, 1 br label %_llgo_1 @@ -40,54 +38,48 @@ _llgo_3: ; preds = %_llgo_1 ret %"github.com/goplus/llgo/runtime/internal/runtime.String" %2 } -define %"github.com/goplus/llgo/runtime/internal/runtime.String" @main.info(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testrt/concat.info"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { _llgo_0: %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringCat"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.String" %0) %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringCat"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %1, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 3 }) ret %"github.com/goplus/llgo/runtime/internal/runtime.String" %2 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/concat.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/concat.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/concat.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/concat.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48) - %3 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, i64 0 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, ptr %3, align 8 - %4 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, i64 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, ptr %4, align 8 - %5 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, i64 2 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 5 }, ptr %5, align 8 - %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, i64 3, 1 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 3, 2 - %9 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @main.concat(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %9) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48) + %1 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %0, i64 0 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 5 }, ptr %1, align 8 + %2 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %0, i64 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, ptr %2, align 8 + %3 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %0, i64 2 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 5 }, ptr %3, align 8 + %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %4, i64 3, 1 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %5, i64 3, 2 + %7 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testrt/concat.concat"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %7) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1) declare %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringCat"(%"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.String") -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String") diff --git a/compiler/cl/_testrt/constuptr/out.ll b/compiler/cl/_testrt/constuptr/out.ll index 615063b5..51a39645 100644 --- a/compiler/cl/_testrt/constuptr/out.ll +++ b/compiler/cl/_testrt/constuptr/out.ll @@ -1,36 +1,28 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/constuptr' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/constuptr" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/constuptr.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/constuptr.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/constuptr.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/constuptr.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/constuptr.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr inttoptr (i64 100 to ptr)) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testrt/cstr/out.ll b/compiler/cl/_testrt/cstr/out.ll index ffb971e3..e750ac72 100644 --- a/compiler/cl/_testrt/cstr/out.ll +++ b/compiler/cl/_testrt/cstr/out.ll @@ -1,34 +1,26 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/cstr' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/cstr" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/cstr.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [14 x i8] c"Hello, world\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cstr.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/cstr.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/cstr.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cstr.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() call void (ptr, ...) @printf(ptr @0) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @printf(ptr, ...) diff --git a/compiler/cl/_testrt/cvar/out.ll b/compiler/cl/_testrt/cvar/out.ll index e6a607c9..043864fe 100644 --- a/compiler/cl/_testrt/cvar/out.ll +++ b/compiler/cl/_testrt/cvar/out.ll @@ -1,34 +1,26 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/cvar' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/cvar" @_bar_x = external global { [16 x i8], [2 x ptr] }, align 8 @_bar_y = external global { [16 x i8] }, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/cvar.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cvar.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/cvar.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/cvar.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/cvar.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load { [16 x i8], [2 x ptr] }, ptr @_bar_x, align 8 - %3 = load { [16 x i8] }, ptr @_bar_y, align 1 - ret i32 0 + %0 = load { [16 x i8], [2 x ptr] }, ptr @_bar_x, align 8 + %1 = load { [16 x i8] }, ptr @_bar_y, align 1 + ret void } - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testrt/eface/out.ll b/compiler/cl/_testrt/eface/out.ll index a3787a2d..04cb6423 100644 --- a/compiler/cl/_testrt/eface/out.ll +++ b/compiler/cl/_testrt/eface/out.ll @@ -1,21 +1,19 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/eface' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/eface" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -%main.eface = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testrt/eface.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/abi.Type" = type { i64, i64, i32, i8, i8, i8, i8, { ptr, ptr }, ptr, %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } %"github.com/goplus/llgo/runtime/abi.UncommonType" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", i16, i16, i32 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/eface.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [6 x i8] c"invoke", align 1 @1 = private unnamed_addr constant [7 x i8] c"\09elem: ", align 1 @2 = private unnamed_addr constant [9 x i8] c"\09uncomm: ", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @_llgo_bool = linkonce global ptr null, align 8 @_llgo_int = linkonce global ptr null, align 8 @_llgo_int8 = linkonce global ptr null, align 8 @@ -33,40 +31,40 @@ source_filename = "main" @"[10]_llgo_int" = linkonce global ptr null, align 8 @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac" = linkonce global ptr null, align 8 @_llgo_Pointer = linkonce global ptr null, align 8 -@"main.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/eface.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8" = linkonce global ptr null, align 8 @3 = private unnamed_addr constant [2 x i8] c"$f", align 1 @4 = private unnamed_addr constant [5 x i8] c"$data", align 1 -@5 = private unnamed_addr constant [4 x i8] c"main", align 1 +@5 = private unnamed_addr constant [48 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/eface", align 1 @"*_llgo_int" = linkonce global ptr null, align 8 @"[]_llgo_int" = linkonce global ptr null, align 8 @6 = private unnamed_addr constant [5 x i8] c"hello", align 1 @_llgo_string = linkonce global ptr null, align 8 -@"main.struct$RKbUG45GE4henGMAdmt0Rju0JptyR8NsX7IZLsOI0OM" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/eface.struct$RKbUG45GE4henGMAdmt0Rju0JptyR8NsX7IZLsOI0OM" = linkonce global ptr null, align 8 @7 = private unnamed_addr constant [1 x i8] c"x", align 1 @8 = private unnamed_addr constant [1 x i8] c"y", align 1 @9 = private unnamed_addr constant [1 x i8] c"z", align 1 -@_llgo_main.T = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/eface.T" = linkonce global ptr null, align 8 @10 = private unnamed_addr constant [1 x i8] c"T", align 1 @11 = private unnamed_addr constant [6 x i8] c"Invoke", align 1 -define void @"main.(*T).Invoke"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.(*T).Invoke"(ptr %0) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 6 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) ret void } -define void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, ptr %1, align 8 - %2 = getelementptr inbounds %main.eface, ptr %1, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/eface.eface", ptr %1, i32 0, i32 0 %3 = load ptr, ptr %2, align 8 - call void @main.dumpTyp(ptr %3, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dumpTyp"(ptr %3, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer) ret void } -define void @main.dumpTyp(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dumpTyp"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %1) %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/abi.(*Type).String"(ptr %0) @@ -112,7 +110,7 @@ _llgo_0: _llgo_1: ; preds = %_llgo_0 %22 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).Elem"(ptr %0) %23 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringCat"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %1, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 7 }) - call void @main.dumpTyp(ptr %22, %"github.com/goplus/llgo/runtime/internal/runtime.String" %23) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dumpTyp"(ptr %22, %"github.com/goplus/llgo/runtime/internal/runtime.String" %23) br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 @@ -123,7 +121,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 _llgo_3: ; preds = %_llgo_2 %26 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).Uncommon"(ptr %0) %27 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringCat"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %1, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 9 }) - call void @main.dumpUncommon(ptr %26, %"github.com/goplus/llgo/runtime/internal/runtime.String" %27) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dumpUncommon"(ptr %26, %"github.com/goplus/llgo/runtime/internal/runtime.String" %27) %28 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %0, i32 0, i32 10 %29 = load ptr, ptr %28, align 8 %30 = icmp ne ptr %29, null @@ -137,11 +135,11 @@ _llgo_5: ; preds = %_llgo_3 %32 = load ptr, ptr %31, align 8 %33 = call ptr @"github.com/goplus/llgo/runtime/abi.(*Type).Uncommon"(ptr %32) %34 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringCat"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %1, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 9 }) - call void @main.dumpUncommon(ptr %33, %"github.com/goplus/llgo/runtime/internal/runtime.String" %34) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dumpUncommon"(ptr %33, %"github.com/goplus/llgo/runtime/internal/runtime.String" %34) br label %_llgo_4 } -define void @main.dumpUncommon(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dumpUncommon"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %1) %2 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.UncommonType", ptr %0, i32 0, i32 0 @@ -161,133 +159,129 @@ _llgo_0: ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/eface.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/eface.init$guard", align 1 call void @"github.com/goplus/llgo/runtime/abi.init"() - call void @"main.init$after"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @_llgo_bool, align 8 - %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 - %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, ptr inttoptr (i64 -1 to ptr), 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %4) - %5 = load ptr, ptr @_llgo_int, align 8 - %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %5, 0 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %7) - %8 = load ptr, ptr @_llgo_int8, align 8 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %8, 0 - %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %10) - %11 = load ptr, ptr @_llgo_int16, align 8 - %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %11, 0 - %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %12, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %13) - %14 = load ptr, ptr @_llgo_int32, align 8 - %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %14, 0 - %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %15, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %16) - %17 = load ptr, ptr @_llgo_int64, align 8 - %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %17, 0 - %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %18, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %19) - %20 = load ptr, ptr @_llgo_uint, align 8 - %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %20, 0 - %22 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %21, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %22) - %23 = load ptr, ptr @_llgo_uint8, align 8 - %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %23, 0 - %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %24, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %25) - %26 = load ptr, ptr @_llgo_uint16, align 8 - %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %26, 0 - %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %27, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %28) - %29 = load ptr, ptr @_llgo_uint32, align 8 - %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %29, 0 - %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %30, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %31) - %32 = load ptr, ptr @_llgo_uint64, align 8 - %33 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %32, 0 - %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %33, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %34) - %35 = load ptr, ptr @_llgo_uintptr, align 8 - %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %35, 0 - %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %36, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %37) - %38 = load ptr, ptr @_llgo_float32, align 8 - %39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %38, 0 - %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %39, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %40) - %41 = load ptr, ptr @_llgo_float64, align 8 - %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %41, 0 - %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %42, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %43) - %44 = load ptr, ptr @"[10]_llgo_int", align 8 - %45 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 80) - store [10 x i64] zeroinitializer, ptr %45, align 4 - %46 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %44, 0 - %47 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %46, ptr %45, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %47) - %48 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 - %49 = load ptr, ptr @_llgo_Pointer, align 8 - %50 = load ptr, ptr @"main.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 - %51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store { ptr, ptr } { ptr @"__llgo_stub.main.main$1", ptr null }, ptr %51, align 8 - %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %50, 0 - %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %52, ptr %51, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %53) - %54 = load ptr, ptr @"*_llgo_int", align 8 - %55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %54, 0 - %56 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %55, ptr null, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %56) - %57 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 0) - %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %57, 0 - %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, i64 0, 1 - %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59, i64 0, 2 - %61 = load ptr, ptr @"[]_llgo_int", align 8 - %62 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) - store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, ptr %62, align 8 - %63 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %61, 0 - %64 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %63, ptr %62, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %64) - %65 = load ptr, ptr @_llgo_string, align 8 - %66 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 5 }, ptr %66, align 8 - %67 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %65, 0 - %68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %67, ptr %66, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %68) - %69 = load ptr, ptr @"main.struct$RKbUG45GE4henGMAdmt0Rju0JptyR8NsX7IZLsOI0OM", align 8 - %70 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) - store { i8, i64, i64 } zeroinitializer, ptr %70, align 4 - %71 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %69, 0 - %72 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %71, ptr %70, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %72) - %73 = load ptr, ptr @_llgo_main.T, align 8 - %74 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, ptr %74, align 8 - %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %73, 0 - %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %75, ptr %74, 1 - call void @main.dump(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %76) - ret i32 0 + %0 = load ptr, ptr @_llgo_bool, align 8 + %1 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 + %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %1, ptr inttoptr (i64 -1 to ptr), 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %2) + %3 = load ptr, ptr @_llgo_int, align 8 + %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %4, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %5) + %6 = load ptr, ptr @_llgo_int8, align 8 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %6, 0 + %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %8) + %9 = load ptr, ptr @_llgo_int16, align 8 + %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %9, 0 + %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %11) + %12 = load ptr, ptr @_llgo_int32, align 8 + %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %12, 0 + %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %14) + %15 = load ptr, ptr @_llgo_int64, align 8 + %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %15, 0 + %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %16, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %17) + %18 = load ptr, ptr @_llgo_uint, align 8 + %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %18, 0 + %20 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %19, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %20) + %21 = load ptr, ptr @_llgo_uint8, align 8 + %22 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %21, 0 + %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %22, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %23) + %24 = load ptr, ptr @_llgo_uint16, align 8 + %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %24, 0 + %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %25, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %26) + %27 = load ptr, ptr @_llgo_uint32, align 8 + %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %27, 0 + %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %28, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %29) + %30 = load ptr, ptr @_llgo_uint64, align 8 + %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %30, 0 + %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %31, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %32) + %33 = load ptr, ptr @_llgo_uintptr, align 8 + %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %33, 0 + %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %34, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %35) + %36 = load ptr, ptr @_llgo_float32, align 8 + %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %36, 0 + %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %37, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %38) + %39 = load ptr, ptr @_llgo_float64, align 8 + %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %39, 0 + %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %40, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %41) + %42 = load ptr, ptr @"[10]_llgo_int", align 8 + %43 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 80) + store [10 x i64] zeroinitializer, ptr %43, align 4 + %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %42, 0 + %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %44, ptr %43, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %45) + %46 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 + %47 = load ptr, ptr @_llgo_Pointer, align 8 + %48 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/eface.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 + %49 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/eface.main$1", ptr null }, ptr %49, align 8 + %50 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %48, 0 + %51 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %50, ptr %49, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %51) + %52 = load ptr, ptr @"*_llgo_int", align 8 + %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %52, 0 + %54 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %53, ptr null, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %54) + %55 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 0) + %56 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %55, 0 + %57 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %56, i64 0, 1 + %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %57, i64 0, 2 + %59 = load ptr, ptr @"[]_llgo_int", align 8 + %60 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) + store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, ptr %60, align 8 + %61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %59, 0 + %62 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %61, ptr %60, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %62) + %63 = load ptr, ptr @_llgo_string, align 8 + %64 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 5 }, ptr %64, align 8 + %65 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %63, 0 + %66 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %65, ptr %64, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %66) + %67 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/eface.struct$RKbUG45GE4henGMAdmt0Rju0JptyR8NsX7IZLsOI0OM", align 8 + %68 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) + store { i8, i64, i64 } zeroinitializer, ptr %68, align 4 + %69 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %67, 0 + %70 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %69, ptr %68, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %70) + %71 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/eface.T", align 8 + %72 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, ptr %72, align 8 + %73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %71, 0 + %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %73, ptr %72, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.dump"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %74) + ret void } -define void @"main.main$1"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.main$1"() { _llgo_0: ret void } @@ -314,9 +308,7 @@ declare %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/g declare void @"github.com/goplus/llgo/runtime/abi.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_bool, align 8 %1 = icmp eq ptr %0, null @@ -519,8 +511,8 @@ _llgo_34: ; preds = %_llgo_33, %_llgo_32 %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %72, 0 %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75, i64 2, 1 %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76, i64 2, 2 - %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77) - store ptr %78, ptr @"main.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 + %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 48 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77) + store ptr %78, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/eface.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 %79 = load ptr, ptr @"*_llgo_int", align 8 %80 = icmp eq ptr %79, null br i1 %80, label %_llgo_35, label %_llgo_36 @@ -570,15 +562,15 @@ _llgo_40: ; preds = %_llgo_39, %_llgo_38 %100 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %96, 0 %101 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %100, i64 3, 1 %102 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %101, i64 3, 2 - %103 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 4 }, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %102) - store ptr %103, ptr @"main.struct$RKbUG45GE4henGMAdmt0Rju0JptyR8NsX7IZLsOI0OM", align 8 - %104 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 1 }, i64 24, i64 16, i64 0, i64 1) - %105 = load ptr, ptr @_llgo_main.T, align 8 + %103 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 48 }, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %102) + store ptr %103, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/eface.struct$RKbUG45GE4henGMAdmt0Rju0JptyR8NsX7IZLsOI0OM", align 8 + %104 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 1 }, i64 24, i64 16, i64 0, i64 1) + %105 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/eface.T", align 8 %106 = icmp eq ptr %105, null br i1 %106, label %_llgo_41, label %_llgo_42 _llgo_41: ; preds = %_llgo_40 - store ptr %104, ptr @_llgo_main.T, align 8 + store ptr %104, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/eface.T", align 8 br label %_llgo_42 _llgo_42: ; preds = %_llgo_41, %_llgo_40 @@ -588,8 +580,8 @@ _llgo_42: ; preds = %_llgo_41, %_llgo_40 _llgo_43: ; preds = %_llgo_42 %108 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %109 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 6 }, ptr undef, ptr undef, ptr undef }, ptr %108, 1 - %110 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %109, ptr @"main.(*T).Invoke", 2 - %111 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %110, ptr @"main.(*T).Invoke", 3 + %110 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %109, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/eface.(*T).Invoke", 2 + %111 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %110, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/eface.(*T).Invoke", 3 %112 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %113 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %112, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %111, ptr %113, align 8 @@ -609,9 +601,9 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64, ptr) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) -define linkonce void @"__llgo_stub.main.main$1"(ptr %0) { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/eface.main$1"(ptr %0) { _llgo_0: - tail call void @"main.main$1"() + tail call void @"github.com/goplus/llgo/compiler/cl/_testrt/eface.main$1"() ret void } diff --git a/compiler/cl/_testrt/float2any/out.ll b/compiler/cl/_testrt/float2any/out.ll index 2d097e44..16ade02c 100644 --- a/compiler/cl/_testrt/float2any/out.ll +++ b/compiler/cl/_testrt/float2any/out.ll @@ -1,20 +1,18 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/float2any' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/float2any" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/float2any.init$guard" = global i1 false, align 1 @_llgo_float32 = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 @_llgo_string = linkonce global ptr null, align 8 @1 = private unnamed_addr constant [9 x i8] c"error f32", align 1 @_llgo_float64 = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [9 x i8] c"error f64", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -define void @main.check32(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.check32"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 0 %2 = load ptr, ptr @_llgo_float32, align 8 @@ -51,7 +49,7 @@ _llgo_4: ; preds = %_llgo_0 unreachable } -define void @main.check64(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.check64"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 0 %2 = load ptr, ptr @_llgo_float64, align 8 @@ -87,54 +85,50 @@ _llgo_4: ; preds = %_llgo_0 unreachable } -define float @main.f32() { +define float @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.f32"() { _llgo_0: ret float 0x400921FB60000000 } -define double @main.f64() { +define double @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.f64"() { _llgo_0: ret double 0x400921FB53C8D4F1 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call float @main.f32() - %3 = load ptr, ptr @_llgo_float32, align 8 - %4 = bitcast float %2 to i32 - %5 = inttoptr i32 %4 to ptr - %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr %5, 1 - call void @main.check32(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %7) - %8 = call double @main.f64() - %9 = load ptr, ptr @_llgo_float64, align 8 - %10 = bitcast double %8 to i64 - %11 = inttoptr i64 %10 to ptr - %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %9, 0 - %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %12, ptr %11, 1 - call void @main.check64(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %13) - ret i32 0 + %0 = call float @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.f32"() + %1 = load ptr, ptr @_llgo_float32, align 8 + %2 = bitcast float %0 to i32 + %3 = inttoptr i32 %2 to ptr + %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %1, 0 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %4, ptr %3, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.check32"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %5) + %6 = call double @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.f64"() + %7 = load ptr, ptr @_llgo_float64, align 8 + %8 = bitcast double %6 to i64 + %9 = inttoptr i64 %8 to ptr + %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %7, 0 + %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, ptr %9, 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.check64"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %11) + ret void } -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/float2any.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_float32, align 8 %1 = icmp eq ptr %0, null @@ -174,5 +168,3 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testrt/fprintf/out.ll b/compiler/cl/_testrt/fprintf/out.ll index efdb389d..1e0f0202 100644 --- a/compiler/cl/_testrt/fprintf/out.ll +++ b/compiler/cl/_testrt/fprintf/out.ll @@ -1,36 +1,28 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/fprintf' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/fprintf" -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/fprintf.init$guard" = global i1 false, align 1 @__stderrp = external global ptr, align 8 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @0 = private unnamed_addr constant [10 x i8] c"Hello %d\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/fprintf.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/fprintf.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/fprintf.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/fprintf.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @__stderrp, align 8 - call void (ptr, ptr, ...) @fprintf(ptr %2, ptr @0, i64 100) - ret i32 0 + %0 = load ptr, ptr @__stderrp, align 8 + call void (ptr, ptr, ...) @fprintf(ptr %0, ptr @0, i64 100) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @fprintf(ptr, ptr, ...) diff --git a/compiler/cl/_testrt/freevars/out.ll b/compiler/cl/_testrt/freevars/out.ll index 3cd8f6b1..fa077a37 100644 --- a/compiler/cl/_testrt/freevars/out.ll +++ b/compiler/cl/_testrt/freevars/out.ll @@ -1,51 +1,45 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/freevars' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/freevars" %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/freevars.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @"main.main$1"({ ptr, ptr } { ptr @"__llgo_stub.main.main$2", ptr null }) - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$1"({ ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$2", ptr null }) + ret void } -define void @"main.main$1"({ ptr, ptr } %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$1"({ ptr, ptr } %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) store { ptr, ptr } %0, ptr %1, align 8 %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %3 = getelementptr inbounds { ptr }, ptr %2, i32 0, i32 0 store ptr %1, ptr %3, align 8 - %4 = insertvalue { ptr, ptr } { ptr @"main.main$1$1", ptr undef }, ptr %2, 1 + %4 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$1$1", ptr undef }, ptr %2, 1 %5 = extractvalue { ptr, ptr } %4, 1 %6 = extractvalue { ptr, ptr } %4, 0 call void %6(ptr %5, %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) ret void } -define void @"main.main$1$1"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$1$1"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { _llgo_0: %2 = load { ptr }, ptr %0, align 8 %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) @@ -76,16 +70,14 @@ _llgo_2: ; preds = %_llgo_0 ret void } -define void @"main.main$2"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$2"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { _llgo_0: ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define linkonce void @"__llgo_stub.main.main$2"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$2"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) { _llgo_0: - tail call void @"main.main$2"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) + tail call void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$2"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) ret void } diff --git a/compiler/cl/_testrt/funcaddr/out.ll b/compiler/cl/_testrt/funcaddr/out.ll index 7642d15f..25846aa1 100644 --- a/compiler/cl/_testrt/funcaddr/out.ll +++ b/compiler/cl/_testrt/funcaddr/out.ll @@ -1,64 +1,56 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/funcaddr' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/funcaddr" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.init$guard" = global i1 false, align 1 -define i64 @main.add(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.add"(i64 %0, i64 %1) { _llgo_0: %2 = add i64 %0, %1 ret i64 %2 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - store ptr @main.add, ptr %2, align 8 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - store ptr @"main.main$1", ptr %3, align 8 - %4 = load ptr, ptr %2, align 8 - %5 = icmp eq ptr @main.add, %4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %5) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + store ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.add", ptr %0, align 8 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + store ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.main$1", ptr %1, align 8 + %2 = load ptr, ptr %0, align 8 + %3 = icmp eq ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.add", %2 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %3) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %6 = load ptr, ptr %2, align 8 - %7 = load ptr, ptr %2, align 8 - %8 = icmp eq ptr %6, %7 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %8) + %4 = load ptr, ptr %0, align 8 + %5 = load ptr, ptr %0, align 8 + %6 = icmp eq ptr %4, %5 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %6) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %9 = load ptr, ptr %3, align 8 - %10 = load ptr, ptr %3, align 8 - %11 = icmp eq ptr %9, %10 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %11) + %7 = load ptr, ptr %1, align 8 + %8 = load ptr, ptr %1, align 8 + %9 = icmp eq ptr %7, %8 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %9) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -define i64 @"main.main$1"(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/funcaddr.main$1"(i64 %0, i64 %1) { _llgo_0: %2 = add i64 %0, %1 ret i64 %2 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1) diff --git a/compiler/cl/_testrt/funcdecl/out.ll b/compiler/cl/_testrt/funcdecl/out.ll index 10f921aa..41fcc8c5 100644 --- a/compiler/cl/_testrt/funcdecl/out.ll +++ b/compiler/cl/_testrt/funcdecl/out.ll @@ -1,42 +1,40 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/funcdecl' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/funcdecl" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.rtype = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.rtype" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } -@"main.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.init$guard" = global i1 false, align 1 @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac" = linkonce global ptr null, align 8 @_llgo_Pointer = linkonce global ptr null, align 8 -@"main.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8" = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [2 x i8] c"$f", align 1 @1 = private unnamed_addr constant [5 x i8] c"$data", align 1 -@2 = private unnamed_addr constant [4 x i8] c"main", align 1 +@2 = private unnamed_addr constant [51 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl", align 1 @3 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 @_llgo_string = linkonce global ptr null, align 8 @4 = private unnamed_addr constant [4 x i8] c"demo", align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 @5 = private unnamed_addr constant [5 x i8] c"hello", align 1 -define void @main.check({ ptr, ptr } %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.check"({ ptr, ptr } %0) { _llgo_0: %1 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %2 = load ptr, ptr @_llgo_Pointer, align 8 - %3 = load ptr, ptr @"main.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 + %3 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store { ptr, ptr } { ptr @__llgo_stub.main.demo, ptr null }, ptr %4, align 8 + store { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.demo", ptr null }, ptr %4, align 8 %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0 %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr %4, 1 - %7 = load ptr, ptr @"main.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 + %7 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) store { ptr, ptr } %0, ptr %8, align 8 %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %7, 0 %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, ptr %8, 1 %11 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, 0 - %12 = load ptr, ptr @"main.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 + %12 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 %13 = icmp eq ptr %11, %12 br i1 %13, label %_llgo_1, label %_llgo_2 @@ -44,7 +42,7 @@ _llgo_1: ; preds = %_llgo_0 %14 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, 1 %15 = load { ptr, ptr }, ptr %14, align 8 %16 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, 0 - %17 = load ptr, ptr @"main.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 + %17 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 %18 = icmp eq ptr %16, %17 br i1 %18, label %_llgo_3, label %_llgo_4 @@ -73,10 +71,10 @@ _llgo_3: ; preds = %_llgo_1 %27 = extractvalue { ptr, ptr } %24, 0 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %27) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr @main.demo) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.demo") call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %28 = call ptr @main.closurePtr(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %6) - %29 = call ptr @main.closurePtr(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %10) + %28 = call ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.closurePtr"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %6) + %29 = call ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.closurePtr"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %10) %30 = icmp eq ptr %28, %29 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %30) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) @@ -92,57 +90,53 @@ _llgo_4: ; preds = %_llgo_1 unreachable } -define ptr @main.closurePtr(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.closurePtr"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, ptr %1, align 8 - %2 = getelementptr inbounds %main.rtype, ptr %1, i32 0, i32 1 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.rtype", ptr %1, i32 0, i32 1 %3 = load ptr, ptr %2, align 8 %4 = getelementptr inbounds { ptr, ptr }, ptr %3, i32 0, i32 0 %5 = load ptr, ptr %4, align 8 ret ptr %5 } -define void @main.demo() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.demo"() { _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 5 }) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - call void @main.check({ ptr, ptr } { ptr @__llgo_stub.main.demo, ptr null }) - ret i32 0 -} - -define linkonce void @__llgo_stub.main.demo(ptr %0) { -_llgo_0: - tail call void @main.demo() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.check"({ ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.demo", ptr null }) ret void } -define void @"main.init$after"() { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.demo"(ptr %0) { +_llgo_0: + tail call void @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.demo"() + ret void +} + +define void @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.init$after"() { _llgo_0: %0 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %1 = icmp eq ptr %0, null @@ -194,8 +188,8 @@ _llgo_4: ; preds = %_llgo_3, %_llgo_2 %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %26, 0 %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29, i64 2, 1 %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30, i64 2, 2 - %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31) - store ptr %32, ptr @"main.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 + %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31) + store ptr %32, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/funcdecl.struct$b7Su1hWaFih-M0M9hMk6nO_RD1K_GQu5WjIXQp6Q2e8", align 8 %33 = load ptr, ptr @_llgo_string, align 8 %34 = icmp eq ptr %33, null br i1 %34, label %_llgo_5, label %_llgo_6 @@ -234,5 +228,3 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String") - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testrt/gblarray/out.ll b/compiler/cl/_testrt/gblarray/out.ll index 262bfb20..943c5f91 100644 --- a/compiler/cl/_testrt/gblarray/out.ll +++ b/compiler/cl/_testrt/gblarray/out.ll @@ -1,32 +1,30 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/gblarray' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/gblarray" %"github.com/goplus/llgo/runtime/abi.Type" = type { i64, i64, i32, i8, i8, i8, i8, { ptr, ptr }, ptr, %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@main.basicTypes = global [25 x ptr] zeroinitializer, align 8 -@"main.init$guard" = global i1 false, align 1 -@main.sizeBasicTypes = global [25 x i64] zeroinitializer, align 8 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.basicTypes" = global [25 x ptr] zeroinitializer, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.sizeBasicTypes" = global [25 x i64] zeroinitializer, align 8 @0 = private unnamed_addr constant [20 x i8] c"Kind: %d, Size: %d\0A\00", align 1 -define ptr @main.Basic(i64 %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.Basic"(i64 %0) { _llgo_0: %1 = icmp sge i64 %0, 25 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %1) - %2 = getelementptr inbounds ptr, ptr @main.basicTypes, i64 %0 + %2 = getelementptr inbounds ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.basicTypes", i64 %0 %3 = load ptr, ptr %2, align 8 ret ptr %3 } -define ptr @main.basicType(i64 %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.basicType"(i64 %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 72) %2 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %1, i32 0, i32 0 %3 = icmp sge i64 %0, 25 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %3) - %4 = getelementptr inbounds i64, ptr @main.sizeBasicTypes, i64 %0 + %4 = getelementptr inbounds i64, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.sizeBasicTypes", i64 %0 %5 = load i64, ptr %4, align 4 %6 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %1, i32 0, i32 2 %7 = trunc i64 %0 to i32 @@ -38,37 +36,33 @@ _llgo_0: ret ptr %1 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.init$guard", align 1 call void @"github.com/goplus/llgo/runtime/abi.init"() - store i64 16, ptr getelementptr inbounds (i64, ptr @main.sizeBasicTypes, i64 24), align 4 - %1 = call ptr @main.basicType(i64 24) - store ptr %1, ptr getelementptr inbounds (ptr, ptr @main.basicTypes, i64 24), align 8 + store i64 16, ptr getelementptr inbounds (i64, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.sizeBasicTypes", i64 24), align 4 + %1 = call ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.basicType"(i64 24) + store ptr %1, ptr getelementptr inbounds (ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.basicTypes", i64 24), align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @main.Basic(i64 24) - %3 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %2, i32 0, i32 6 - %4 = load i8, ptr %3, align 1 - %5 = sext i8 %4 to i64 - %6 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %2, i32 0, i32 0 - %7 = load i64, ptr %6, align 4 - %8 = call i32 (ptr, ...) @printf(ptr @0, i64 %5, i64 %7) - ret i32 0 + %0 = call ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gblarray.Basic"(i64 24) + %1 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %0, i32 0, i32 6 + %2 = load i8, ptr %1, align 1 + %3 = sext i8 %2 to i64 + %4 = getelementptr inbounds %"github.com/goplus/llgo/runtime/abi.Type", ptr %0, i32 0, i32 0 + %5 = load i64, ptr %4, align 4 + %6 = call i32 (ptr, ...) @printf(ptr @0, i64 %3, i64 %5) + ret void } declare void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1) @@ -77,6 +71,4 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare void @"github.com/goplus/llgo/runtime/abi.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testrt/gotypes/out.ll b/compiler/cl/_testrt/gotypes/out.ll index 328e87fa..4c8f0f48 100644 --- a/compiler/cl/_testrt/gotypes/out.ll +++ b/compiler/cl/_testrt/gotypes/out.ll @@ -1,38 +1,30 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/gotypes' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/gotypes" %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/gotypes.init$guard" = global i1 false, align 1 -define void @main.foo(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/gotypes.foo"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) { _llgo_0: ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/gotypes.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gotypes.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/gotypes.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/gotypes.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.foo(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/gotypes.foo"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer) + ret void } - -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() diff --git a/compiler/cl/_testrt/hello/out.ll b/compiler/cl/_testrt/hello/out.ll index 6a38932f..6dfd0159 100644 --- a/compiler/cl/_testrt/hello/out.ll +++ b/compiler/cl/_testrt/hello/out.ll @@ -1,47 +1,39 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/hello' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/hello" -@main.format = global [10 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/hello.format" = global [10 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/hello.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/hello.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.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 - store i8 72, ptr @main.format, align 1 - store i8 101, ptr getelementptr inbounds (i8, ptr @main.format, i64 1), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 2), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 3), align 1 - store i8 111, ptr getelementptr inbounds (i8, ptr @main.format, i64 4), align 1 - store i8 32, ptr getelementptr inbounds (i8, ptr @main.format, i64 5), align 1 - store i8 37, ptr getelementptr inbounds (i8, ptr @main.format, i64 6), align 1 - store i8 100, ptr getelementptr inbounds (i8, ptr @main.format, i64 7), align 1 - store i8 10, ptr getelementptr inbounds (i8, ptr @main.format, i64 8), align 1 - store i8 0, ptr getelementptr inbounds (i8, ptr @main.format, i64 9), align 1 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.init$guard", align 1 + store i8 72, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", align 1 + store i8 101, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i64 1), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i64 2), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i64 3), align 1 + store i8 111, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i64 4), align 1 + store i8 32, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i64 5), align 1 + store i8 37, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i64 6), align 1 + store i8 100, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i64 7), align 1 + store i8 10, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i64 8), align 1 + store i8 0, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i64 9), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/hello.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call i32 @strlen(ptr @main.format) - call void (ptr, ...) @printf(ptr @main.format, i32 %2) - ret i32 0 + %0 = call i32 @strlen(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format") + call void (ptr, ...) @printf(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/hello.format", i32 %0) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @strlen(ptr) declare void @printf(ptr, ...) diff --git a/compiler/cl/_testrt/index/out.ll b/compiler/cl/_testrt/index/out.ll index c94cc585..fb1f6b26 100644 --- a/compiler/cl/_testrt/index/out.ll +++ b/compiler/cl/_testrt/index/out.ll @@ -1,154 +1,146 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/index' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/index" -%main.point = type { i64, i64 } +%"github.com/goplus/llgo/compiler/cl/_testrt/index.point" = type { i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/index.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [6 x i8] c"123456", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/index.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/index.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/index.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/index.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = alloca %main.point, align 8 - call void @llvm.memset(ptr %2, i8 0, i64 16, i1 false) - %3 = alloca [3 x %main.point], align 8 - call void @llvm.memset(ptr %3, i8 0, i64 48, i1 false) - %4 = getelementptr inbounds %main.point, ptr %3, i64 0 - %5 = getelementptr inbounds %main.point, ptr %4, i32 0, i32 0 - %6 = getelementptr inbounds %main.point, ptr %4, i32 0, i32 1 - %7 = getelementptr inbounds %main.point, ptr %3, i64 1 - %8 = getelementptr inbounds %main.point, ptr %7, i32 0, i32 0 - %9 = getelementptr inbounds %main.point, ptr %7, i32 0, i32 1 - %10 = getelementptr inbounds %main.point, ptr %3, i64 2 - %11 = getelementptr inbounds %main.point, ptr %10, i32 0, i32 0 - %12 = getelementptr inbounds %main.point, ptr %10, i32 0, i32 1 - store i64 1, ptr %5, align 4 - store i64 2, ptr %6, align 4 - store i64 3, ptr %8, align 4 - store i64 4, ptr %9, align 4 - store i64 5, ptr %11, align 4 - store i64 6, ptr %12, align 4 - %13 = load [3 x %main.point], ptr %3, align 4 - %14 = getelementptr inbounds %main.point, ptr %3, i64 2 - %15 = load %main.point, ptr %14, align 4 - store %main.point %15, ptr %2, align 4 - %16 = getelementptr inbounds %main.point, ptr %2, i32 0, i32 0 + %0 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", align 8 + call void @llvm.memset(ptr %0, i8 0, i64 16, i1 false) + %1 = alloca [3 x %"github.com/goplus/llgo/compiler/cl/_testrt/index.point"], align 8 + call void @llvm.memset(ptr %1, i8 0, i64 48, i1 false) + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %1, i64 0 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %2, i32 0, i32 0 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %2, i32 0, i32 1 + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %1, i64 1 + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %5, i32 0, i32 0 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %5, i32 0, i32 1 + %8 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %1, i64 2 + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %8, i32 0, i32 0 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %8, i32 0, i32 1 + store i64 1, ptr %3, align 4 + store i64 2, ptr %4, align 4 + store i64 3, ptr %6, align 4 + store i64 4, ptr %7, align 4 + store i64 5, ptr %9, align 4 + store i64 6, ptr %10, align 4 + %11 = load [3 x %"github.com/goplus/llgo/compiler/cl/_testrt/index.point"], ptr %1, align 4 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %1, i64 2 + %13 = load %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %12, align 4 + store %"github.com/goplus/llgo/compiler/cl/_testrt/index.point" %13, ptr %0, align 4 + %14 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %0, i32 0, i32 0 + %15 = load i64, ptr %14, align 4 + %16 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/index.point", ptr %0, i32 0, i32 1 %17 = load i64, ptr %16, align 4 - %18 = getelementptr inbounds %main.point, ptr %2, i32 0, i32 1 - %19 = load i64, ptr %18, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %15) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %17) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %19) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %20 = alloca [2 x i64], align 8 - call void @llvm.memset(ptr %20, i8 0, i64 16, i1 false) - %21 = alloca [2 x [2 x i64]], align 8 - call void @llvm.memset(ptr %21, i8 0, i64 32, i1 false) - %22 = getelementptr inbounds [2 x i64], ptr %21, i64 0 - %23 = getelementptr inbounds i64, ptr %22, i64 0 - %24 = getelementptr inbounds i64, ptr %22, i64 1 - %25 = getelementptr inbounds [2 x i64], ptr %21, i64 1 - %26 = getelementptr inbounds i64, ptr %25, i64 0 - %27 = getelementptr inbounds i64, ptr %25, i64 1 - store i64 1, ptr %23, align 4 - store i64 2, ptr %24, align 4 - store i64 3, ptr %26, align 4 - store i64 4, ptr %27, align 4 - %28 = load [2 x [2 x i64]], ptr %21, align 4 - %29 = getelementptr inbounds [2 x i64], ptr %21, i64 1 - %30 = load [2 x i64], ptr %29, align 4 - store [2 x i64] %30, ptr %20, align 4 - %31 = getelementptr inbounds i64, ptr %20, i64 0 + %18 = alloca [2 x i64], align 8 + call void @llvm.memset(ptr %18, i8 0, i64 16, i1 false) + %19 = alloca [2 x [2 x i64]], align 8 + call void @llvm.memset(ptr %19, i8 0, i64 32, i1 false) + %20 = getelementptr inbounds [2 x i64], ptr %19, i64 0 + %21 = getelementptr inbounds i64, ptr %20, i64 0 + %22 = getelementptr inbounds i64, ptr %20, i64 1 + %23 = getelementptr inbounds [2 x i64], ptr %19, i64 1 + %24 = getelementptr inbounds i64, ptr %23, i64 0 + %25 = getelementptr inbounds i64, ptr %23, i64 1 + store i64 1, ptr %21, align 4 + store i64 2, ptr %22, align 4 + store i64 3, ptr %24, align 4 + store i64 4, ptr %25, align 4 + %26 = load [2 x [2 x i64]], ptr %19, align 4 + %27 = getelementptr inbounds [2 x i64], ptr %19, i64 1 + %28 = load [2 x i64], ptr %27, align 4 + store [2 x i64] %28, ptr %18, align 4 + %29 = getelementptr inbounds i64, ptr %18, i64 0 + %30 = load i64, ptr %29, align 4 + %31 = getelementptr inbounds i64, ptr %18, i64 1 %32 = load i64, ptr %31, align 4 - %33 = getelementptr inbounds i64, ptr %20, i64 1 - %34 = load i64, ptr %33, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %32) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %30) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %34) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %35 = alloca [5 x i64], align 8 - call void @llvm.memset(ptr %35, i8 0, i64 40, i1 false) - %36 = getelementptr inbounds i64, ptr %35, i64 0 - %37 = getelementptr inbounds i64, ptr %35, i64 1 - %38 = getelementptr inbounds i64, ptr %35, i64 2 - %39 = getelementptr inbounds i64, ptr %35, i64 3 - %40 = getelementptr inbounds i64, ptr %35, i64 4 - store i64 1, ptr %36, align 4 - store i64 2, ptr %37, align 4 - store i64 3, ptr %38, align 4 - store i64 4, ptr %39, align 4 - store i64 5, ptr %40, align 4 - %41 = load [5 x i64], ptr %35, align 4 - %42 = getelementptr inbounds i64, ptr %35, i64 2 - %43 = load i64, ptr %42, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %43) + %33 = alloca [5 x i64], align 8 + call void @llvm.memset(ptr %33, i8 0, i64 40, i1 false) + %34 = getelementptr inbounds i64, ptr %33, i64 0 + %35 = getelementptr inbounds i64, ptr %33, i64 1 + %36 = getelementptr inbounds i64, ptr %33, i64 2 + %37 = getelementptr inbounds i64, ptr %33, i64 3 + %38 = getelementptr inbounds i64, ptr %33, i64 4 + store i64 1, ptr %34, align 4 + store i64 2, ptr %35, align 4 + store i64 3, ptr %36, align 4 + store i64 4, ptr %37, align 4 + store i64 5, ptr %38, align 4 + %39 = load [5 x i64], ptr %33, align 4 + %40 = getelementptr inbounds i64, ptr %33, i64 2 + %41 = load i64, ptr %40, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %41) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %44 = load i8, ptr getelementptr inbounds (i8, ptr @0, i64 2), align 1 - %45 = sext i8 %44 to i32 - %46 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRune"(i32 %45) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %46) + %42 = load i8, ptr getelementptr inbounds (i8, ptr @0, i64 2), align 1 + %43 = sext i8 %42 to i32 + %44 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRune"(i32 %43) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %44) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %47 = load i8, ptr getelementptr inbounds (i8, ptr @0, i64 1), align 1 - %48 = sext i8 %47 to i32 - %49 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRune"(i32 %48) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %49) + %45 = load i8, ptr getelementptr inbounds (i8, ptr @0, i64 1), align 1 + %46 = sext i8 %45 to i32 + %47 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/runtime/internal/runtime.StringFromRune"(i32 %46) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %47) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %50 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %51 = getelementptr inbounds i64, ptr %50, i64 0 - %52 = getelementptr inbounds i64, ptr %50, i64 1 - store i64 1, ptr %51, align 4 - store i64 2, ptr %52, align 4 - %53 = getelementptr inbounds i64, ptr %50, i64 1 - %54 = load i64, ptr %53, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %54) + %48 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + %49 = getelementptr inbounds i64, ptr %48, i64 0 + %50 = getelementptr inbounds i64, ptr %48, i64 1 + store i64 1, ptr %49, align 4 + store i64 2, ptr %50, align 4 + %51 = getelementptr inbounds i64, ptr %48, i64 1 + %52 = load i64, ptr %51, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %52) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %55 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %56 = getelementptr inbounds i64, ptr %55, i64 0 - store i64 1, ptr %56, align 4 - %57 = getelementptr inbounds i64, ptr %55, i64 1 - store i64 2, ptr %57, align 4 - %58 = getelementptr inbounds i64, ptr %55, i64 2 - store i64 3, ptr %58, align 4 - %59 = getelementptr inbounds i64, ptr %55, i64 3 - store i64 4, ptr %59, align 4 - %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %55, 0 - %61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, i64 4, 1 - %62 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61, i64 4, 2 - %63 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %62, 0 - %64 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %62, 1 - %65 = icmp sge i64 1, %64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %65) - %66 = getelementptr inbounds i64, ptr %63, i64 1 - %67 = load i64, ptr %66, align 4 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %67) + %53 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %54 = getelementptr inbounds i64, ptr %53, i64 0 + store i64 1, ptr %54, align 4 + %55 = getelementptr inbounds i64, ptr %53, i64 1 + store i64 2, ptr %55, align 4 + %56 = getelementptr inbounds i64, ptr %53, i64 2 + store i64 3, ptr %56, align 4 + %57 = getelementptr inbounds i64, ptr %53, i64 3 + store i64 4, ptr %57, align 4 + %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %53, 0 + %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, i64 4, 1 + %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59, i64 4, 2 + %61 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, 0 + %62 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, 1 + %63 = icmp sge i64 1, %62 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %63) + %64 = getelementptr inbounds i64, ptr %61, i64 1 + %65 = load i64, ptr %64, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %65) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0 diff --git a/compiler/cl/_testrt/intgen/out.ll b/compiler/cl/_testrt/intgen/out.ll index eeae5b04..0d6be07d 100644 --- a/compiler/cl/_testrt/intgen/out.ll +++ b/compiler/cl/_testrt/intgen/out.ll @@ -1,17 +1,15 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/intgen' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/intgen" %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -%main.generator = type { i32 } +%"github.com/goplus/llgo/compiler/cl/_testrt/intgen.generator" = type { i32 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/intgen.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 -define %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @main.genInts(i64 %0, { ptr, ptr } %1) { +define %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.genInts"(i64 %0, { ptr, ptr } %1) { _llgo_0: %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.MakeSlice"(i64 %0, i64 %0, i64 4) %3 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %2, 1 @@ -41,123 +39,119 @@ _llgo_3: ; preds = %_llgo_1 ret %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %2 } -define i32 @"main.(*generator).next"(ptr %0) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.(*generator).next"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %main.generator, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/intgen.generator", ptr %0, i32 0, i32 0 %2 = load i32, ptr %1, align 4 %3 = add i32 %2, 1 - %4 = getelementptr inbounds %main.generator, ptr %0, i32 0, i32 0 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/intgen.generator", ptr %0, i32 0, i32 0 store i32 %3, ptr %4, align 4 - %5 = getelementptr inbounds %main.generator, ptr %0, i32 0, i32 0 + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/intgen.generator", ptr %0, i32 0, i32 0 %6 = load i32, ptr %5, align 4 ret i32 %6 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @main.genInts(i64 5, { ptr, ptr } { ptr @__llgo_stub.rand, ptr null }) - %3 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %2, 1 + %0 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.genInts"(i64 5, { ptr, ptr } { ptr @__llgo_stub.rand, ptr null }) + %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, 1 br label %_llgo_1 _llgo_1: ; preds = %_llgo_2, %_llgo_0 - %4 = phi i64 [ -1, %_llgo_0 ], [ %5, %_llgo_2 ] - %5 = add i64 %4, 1 - %6 = icmp slt i64 %5, %3 - br i1 %6, label %_llgo_2, label %_llgo_3 + %2 = phi i64 [ -1, %_llgo_0 ], [ %3, %_llgo_2 ] + %3 = add i64 %2, 1 + %4 = icmp slt i64 %3, %1 + br i1 %4, label %_llgo_2, label %_llgo_3 _llgo_2: ; preds = %_llgo_1 - %7 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %2, 0 - %8 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %2, 1 - %9 = icmp slt i64 %5, 0 - %10 = icmp sge i64 %5, %8 - %11 = or i1 %10, %9 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %11) - %12 = getelementptr inbounds i32, ptr %7, i64 %5 - %13 = load i32, ptr %12, align 4 - %14 = call i32 (ptr, ...) @printf(ptr @0, i32 %13) + %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, 0 + %6 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, 1 + %7 = icmp slt i64 %3, 0 + %8 = icmp sge i64 %3, %6 + %9 = or i1 %8, %7 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %9) + %10 = getelementptr inbounds i32, ptr %5, i64 %3 + %11 = load i32, ptr %10, align 4 + %12 = call i32 (ptr, ...) @printf(ptr @0, i32 %11) br label %_llgo_1 _llgo_3: ; preds = %_llgo_1 - %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) - store i32 1, ptr %15, align 4 - %16 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %17 = getelementptr inbounds { ptr }, ptr %16, i32 0, i32 0 - store ptr %15, ptr %17, align 8 - %18 = insertvalue { ptr, ptr } { ptr @"main.main$1", ptr undef }, ptr %16, 1 - %19 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @main.genInts(i64 5, { ptr, ptr } %18) - %20 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19, 1 + %13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) + store i32 1, ptr %13, align 4 + %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %15 = getelementptr inbounds { ptr }, ptr %14, i32 0, i32 0 + store ptr %13, ptr %15, align 8 + %16 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.main$1", ptr undef }, ptr %14, 1 + %17 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.genInts"(i64 5, { ptr, ptr } %16) + %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, 1 br label %_llgo_4 _llgo_4: ; preds = %_llgo_5, %_llgo_3 - %21 = phi i64 [ -1, %_llgo_3 ], [ %22, %_llgo_5 ] - %22 = add i64 %21, 1 - %23 = icmp slt i64 %22, %20 - br i1 %23, label %_llgo_5, label %_llgo_6 + %19 = phi i64 [ -1, %_llgo_3 ], [ %20, %_llgo_5 ] + %20 = add i64 %19, 1 + %21 = icmp slt i64 %20, %18 + br i1 %21, label %_llgo_5, label %_llgo_6 _llgo_5: ; preds = %_llgo_4 - %24 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19, 0 - %25 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19, 1 - %26 = icmp slt i64 %22, 0 - %27 = icmp sge i64 %22, %25 - %28 = or i1 %27, %26 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %28) - %29 = getelementptr inbounds i32, ptr %24, i64 %22 - %30 = load i32, ptr %29, align 4 - %31 = call i32 (ptr, ...) @printf(ptr @1, i32 %30) + %22 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, 0 + %23 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, 1 + %24 = icmp slt i64 %20, 0 + %25 = icmp sge i64 %20, %23 + %26 = or i1 %25, %24 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %26) + %27 = getelementptr inbounds i32, ptr %22, i64 %20 + %28 = load i32, ptr %27, align 4 + %29 = call i32 (ptr, ...) @printf(ptr @1, i32 %28) br label %_llgo_4 _llgo_6: ; preds = %_llgo_4 - %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) - %33 = getelementptr inbounds %main.generator, ptr %32, i32 0, i32 0 - store i32 1, ptr %33, align 4 - %34 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %35 = getelementptr inbounds { ptr }, ptr %34, i32 0, i32 0 - store ptr %32, ptr %35, align 8 - %36 = insertvalue { ptr, ptr } { ptr @"main.next$bound", ptr undef }, ptr %34, 1 - %37 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @main.genInts(i64 5, { ptr, ptr } %36) - %38 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37, 1 + %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) + %31 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/intgen.generator", ptr %30, i32 0, i32 0 + store i32 1, ptr %31, align 4 + %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %33 = getelementptr inbounds { ptr }, ptr %32, i32 0, i32 0 + store ptr %30, ptr %33, align 8 + %34 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.next$bound", ptr undef }, ptr %32, 1 + %35 = call %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.genInts"(i64 5, { ptr, ptr } %34) + %36 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35, 1 br label %_llgo_7 _llgo_7: ; preds = %_llgo_8, %_llgo_6 - %39 = phi i64 [ -1, %_llgo_6 ], [ %40, %_llgo_8 ] - %40 = add i64 %39, 1 - %41 = icmp slt i64 %40, %38 - br i1 %41, label %_llgo_8, label %_llgo_9 + %37 = phi i64 [ -1, %_llgo_6 ], [ %38, %_llgo_8 ] + %38 = add i64 %37, 1 + %39 = icmp slt i64 %38, %36 + br i1 %39, label %_llgo_8, label %_llgo_9 _llgo_8: ; preds = %_llgo_7 - %42 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37, 0 - %43 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37, 1 - %44 = icmp slt i64 %40, 0 - %45 = icmp sge i64 %40, %43 - %46 = or i1 %45, %44 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %46) - %47 = getelementptr inbounds i32, ptr %42, i64 %40 - %48 = load i32, ptr %47, align 4 - %49 = call i32 (ptr, ...) @printf(ptr @2, i32 %48) + %40 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35, 0 + %41 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35, 1 + %42 = icmp slt i64 %38, 0 + %43 = icmp sge i64 %38, %41 + %44 = or i1 %43, %42 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %44) + %45 = getelementptr inbounds i32, ptr %40, i64 %38 + %46 = load i32, ptr %45, align 4 + %47 = call i32 (ptr, ...) @printf(ptr @2, i32 %46) br label %_llgo_7 _llgo_9: ; preds = %_llgo_7 - ret i32 0 + ret void } -define i32 @"main.main$1"(ptr %0) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.main$1"(ptr %0) { _llgo_0: %1 = load { ptr }, ptr %0, align 8 %2 = extractvalue { ptr } %1, 0 @@ -174,8 +168,6 @@ declare %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/go declare void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1) -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @rand() define linkonce i32 @__llgo_stub.rand(ptr %0) { @@ -190,10 +182,10 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) -define i32 @"main.next$bound"(ptr %0) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.next$bound"(ptr %0) { _llgo_0: %1 = load { ptr }, ptr %0, align 8 %2 = extractvalue { ptr } %1, 0 - %3 = call i32 @"main.(*generator).next"(ptr %2) + %3 = call i32 @"github.com/goplus/llgo/compiler/cl/_testrt/intgen.(*generator).next"(ptr %2) ret i32 %3 } diff --git a/compiler/cl/_testrt/len/out.ll b/compiler/cl/_testrt/len/out.ll index 20e5f484..a23dfcfb 100644 --- a/compiler/cl/_testrt/len/out.ll +++ b/compiler/cl/_testrt/len/out.ll @@ -1,14 +1,12 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/len' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/len" -%main.data = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" } +%"github.com/goplus/llgo/compiler/cl/_testrt/len.data" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/len.init$guard" = global i1 false, align 1 @_llgo_int = linkonce global ptr null, align 8 @_llgo_string = linkonce global ptr null, align 8 @"map[_llgo_int]_llgo_string" = linkonce global ptr null, align 8 @@ -16,124 +14,118 @@ source_filename = "main" @1 = private unnamed_addr constant [4 x i8] c"keys", align 1 @2 = private unnamed_addr constant [5 x i8] c"elems", align 1 @3 = private unnamed_addr constant [8 x i8] c"overflow", align 1 -@4 = private unnamed_addr constant [4 x i8] c"main", align 1 +@4 = private unnamed_addr constant [46 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/len", align 1 @5 = private unnamed_addr constant [5 x i8] c"hello", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/len.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/len.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/len.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/len.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/len.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 56) - %3 = getelementptr inbounds %main.data, ptr %2, i32 0, i32 0 - %4 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %3, align 8 - %5 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %4, 1 - %6 = getelementptr inbounds %main.data, ptr %2, i32 0, i32 1 - %7 = load ptr, ptr %6, align 8 - %8 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.ChanLen"(ptr %7) - %9 = getelementptr inbounds %main.data, ptr %2, i32 0, i32 2 - %10 = load ptr, ptr %9, align 8 - %11 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.MapLen"(ptr %10) - %12 = getelementptr inbounds %main.data, ptr %2, i32 0, i32 3 - %13 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %12, align 8 - %14 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %13, 1 - %15 = getelementptr inbounds %main.data, ptr %2, i32 0, i32 1 - %16 = load ptr, ptr %15, align 8 - %17 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.ChanCap"(ptr %16) - %18 = getelementptr inbounds %main.data, ptr %2, i32 0, i32 3 - %19 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %18, align 8 - %20 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19, 2 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %5) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 56) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %0, i32 0, i32 0 + %2 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %1, align 8 + %3 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %2, 1 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %0, i32 0, i32 1 + %5 = load ptr, ptr %4, align 8 + %6 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.ChanLen"(ptr %5) + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %0, i32 0, i32 2 + %8 = load ptr, ptr %7, align 8 + %9 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.MapLen"(ptr %8) + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %0, i32 0, i32 3 + %11 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %10, align 8 + %12 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %11, 1 + %13 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %0, i32 0, i32 1 + %14 = load ptr, ptr %13, align 8 + %15 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.ChanCap"(ptr %14) + %16 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %0, i32 0, i32 3 + %17 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %16, align 8 + %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, 2 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %3) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %8) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %6) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %11) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %9) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %14) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %12) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %17) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %15) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %20) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %18) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 56) - %22 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 0 - %23 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 1 - %24 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 8, i64 2) - %25 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 2 - %26 = load ptr, ptr @_llgo_int, align 8 - %27 = load ptr, ptr @_llgo_string, align 8 + %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 56) + %20 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 0 + %21 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 1 + %22 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 8, i64 2) + %23 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 2 + %24 = load ptr, ptr @_llgo_int, align 8 + %25 = load ptr, ptr @_llgo_string, align 8 + %26 = load ptr, ptr @"map[_llgo_int]_llgo_string", align 8 + %27 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %26, i64 1) %28 = load ptr, ptr @"map[_llgo_int]_llgo_string", align 8 - %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %28, i64 1) - %30 = load ptr, ptr @"map[_llgo_int]_llgo_string", align 8 - %31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - store i64 1, ptr %31, align 4 - %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %30, ptr %29, ptr %31) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 5 }, ptr %32, align 8 - %33 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 3 - %34 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %35 = getelementptr inbounds i64, ptr %34, i64 0 - store i64 1, ptr %35, align 4 - %36 = getelementptr inbounds i64, ptr %34, i64 1 - store i64 2, ptr %36, align 4 - %37 = getelementptr inbounds i64, ptr %34, i64 2 - store i64 3, ptr %37, align 4 - %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %34, 0 - %39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38, i64 3, 1 - %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %39, i64 3, 2 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 5 }, ptr %22, align 8 - store ptr %24, ptr %23, align 8 - store ptr %29, ptr %25, align 8 - store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40, ptr %33, align 8 - %41 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 0 - %42 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %41, align 8 - %43 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %42, 1 - %44 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 1 - %45 = load ptr, ptr %44, align 8 - %46 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.ChanLen"(ptr %45) - %47 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 2 - %48 = load ptr, ptr %47, align 8 - %49 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.MapLen"(ptr %48) - %50 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 3 - %51 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %50, align 8 - %52 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %51, 1 - %53 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 1 - %54 = load ptr, ptr %53, align 8 - %55 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.ChanCap"(ptr %54) - %56 = getelementptr inbounds %main.data, ptr %21, i32 0, i32 3 - %57 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %56, align 8 - %58 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %57, 2 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %43) + %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + store i64 1, ptr %29, align 4 + %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %28, ptr %27, ptr %29) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 5 }, ptr %30, align 8 + %31 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 3 + %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) + %33 = getelementptr inbounds i64, ptr %32, i64 0 + store i64 1, ptr %33, align 4 + %34 = getelementptr inbounds i64, ptr %32, i64 1 + store i64 2, ptr %34, align 4 + %35 = getelementptr inbounds i64, ptr %32, i64 2 + store i64 3, ptr %35, align 4 + %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %32, 0 + %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36, i64 3, 1 + %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37, i64 3, 2 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 5 }, ptr %20, align 8 + store ptr %22, ptr %21, align 8 + store ptr %27, ptr %23, align 8 + store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38, ptr %31, align 8 + %39 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 0 + %40 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %39, align 8 + %41 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %40, 1 + %42 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 1 + %43 = load ptr, ptr %42, align 8 + %44 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.ChanLen"(ptr %43) + %45 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 2 + %46 = load ptr, ptr %45, align 8 + %47 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.MapLen"(ptr %46) + %48 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 3 + %49 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %48, align 8 + %50 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %49, 1 + %51 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 1 + %52 = load ptr, ptr %51, align 8 + %53 = call i64 @"github.com/goplus/llgo/runtime/internal/runtime.ChanCap"(ptr %52) + %54 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/len.data", ptr %19, i32 0, i32 3 + %55 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %54, align 8 + %56 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %55, 2 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %41) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %46) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %44) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %49) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %47) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %52) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %50) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %55) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %53) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %58) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %56) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare i64 @"github.com/goplus/llgo/runtime/internal/runtime.ChanLen"(ptr) @@ -148,7 +140,7 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64, i64) -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/len.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = icmp eq ptr %0, null @@ -200,7 +192,7 @@ _llgo_5: ; preds = %_llgo_4 %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %21, 0 %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %26, i64 4, 1 %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27, i64 4, 2 - %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28) + %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 46 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28) %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %8, ptr %9, ptr %29, i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %30) store ptr %30, ptr @"map[_llgo_int]_llgo_string", align 8 diff --git a/compiler/cl/_testrt/linkname/out.ll b/compiler/cl/_testrt/linkname/out.ll index 9f3855ee..69b8a0c7 100644 --- a/compiler/cl/_testrt/linkname/out.ll +++ b/compiler/cl/_testrt/linkname/out.ll @@ -1,12 +1,10 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/linkname' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/linkname" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%main.m = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } +%"github.com/goplus/llgo/compiler/cl/_testrt/linkname.m" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String" } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/linkname.init$guard" = global i1 false, align 1 @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 @@ -17,15 +15,15 @@ source_filename = "main" @7 = private unnamed_addr constant [2 x i8] c"4\00", align 1 @8 = private unnamed_addr constant [5 x i8] c"hello", align 1 -declare %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.m.info"(%main.m) +declare %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.m.info"(%"github.com/goplus/llgo/compiler/cl/_testrt/linkname.m") -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/linkname.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/linkname.init$guard", align 1 call void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.init"() br label %_llgo_2 @@ -33,21 +31,17 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() call void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.F"(ptr @0, ptr @1, ptr @2, ptr @3) call void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.F"(ptr @4, ptr @5, ptr @6, ptr @7) - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - call void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.(*m).setInfo"(ptr %2, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 5 }) - %3 = load %main.m, ptr %2, align 8 - %4 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.m.info"(%main.m %3) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %4) + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + call void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.(*m).setInfo"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 5 }) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testrt/linkname.m", ptr %0, align 8 + %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.m.info"(%"github.com/goplus/llgo/compiler/cl/_testrt/linkname.m" %1) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %2) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } declare void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.F"(ptr, ptr, ptr, ptr) @@ -56,8 +50,6 @@ declare void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.(* declare void @"github.com/goplus/llgo/compiler/cl/_testrt/linkname/linktarget.init"() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String") diff --git a/compiler/cl/_testrt/makemap/out.ll b/compiler/cl/_testrt/makemap/out.ll index 10328f4b..439c5c66 100644 --- a/compiler/cl/_testrt/makemap/out.ll +++ b/compiler/cl/_testrt/makemap/out.ll @@ -1,15 +1,13 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/makemap' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/makemap" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -%main.N = type { i8, i8 } +%"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N" = type { i8, i8 } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/makemap.init$guard" = global i1 false, align 1 @_llgo_int = linkonce global ptr null, align 8 @_llgo_string = linkonce global ptr null, align 8 @"map[_llgo_int]_llgo_string" = linkonce global ptr null, align 8 @@ -17,7 +15,7 @@ source_filename = "main" @1 = private unnamed_addr constant [4 x i8] c"keys", align 1 @2 = private unnamed_addr constant [5 x i8] c"elems", align 1 @3 = private unnamed_addr constant [8 x i8] c"overflow", align 1 -@4 = private unnamed_addr constant [4 x i8] c"main", align 1 +@4 = private unnamed_addr constant [50 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/makemap", align 1 @5 = private unnamed_addr constant [5 x i8] c"hello", align 1 @6 = private unnamed_addr constant [5 x i8] c"world", align 1 @7 = private unnamed_addr constant [4 x i8] c"llgo", align 1 @@ -28,61 +26,57 @@ source_filename = "main" @11 = private unnamed_addr constant [7 x i8] c"bad len", align 1 @_llgo_any = linkonce global ptr null, align 8 @"map[_llgo_any]_llgo_int" = linkonce global ptr null, align 8 -@_llgo_main.N1 = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N1" = linkonce global ptr null, align 8 @12 = private unnamed_addr constant [2 x i8] c"N1", align 1 @"[1]_llgo_int" = linkonce global ptr null, align 8 @13 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 -@_llgo_main.K = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K" = linkonce global ptr null, align 8 @14 = private unnamed_addr constant [1 x i8] c"K", align 1 -@_llgo_main.N = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N" = linkonce global ptr null, align 8 @15 = private unnamed_addr constant [1 x i8] c"N", align 1 @_llgo_int8 = linkonce global ptr null, align 8 -@"main.struct$e65EDK9vxC36Nz3YTgO1ulssLlNH03Bva_WWaCjH-4A" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/makemap.struct$e65EDK9vxC36Nz3YTgO1ulssLlNH03Bva_WWaCjH-4A" = linkonce global ptr null, align 8 @16 = private unnamed_addr constant [2 x i8] c"n1", align 1 @17 = private unnamed_addr constant [2 x i8] c"n2", align 1 -@"[1]_llgo_main.N" = linkonce global ptr null, align 8 -@_llgo_main.K2 = linkonce global ptr null, align 8 +@"[1]_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K2" = linkonce global ptr null, align 8 @18 = private unnamed_addr constant [2 x i8] c"K2", align 1 -@"*_llgo_main.N" = linkonce global ptr null, align 8 -@"[1]*_llgo_main.N" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N" = linkonce global ptr null, align 8 +@"[1]*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N" = linkonce global ptr null, align 8 @"chan _llgo_int" = linkonce global ptr null, align 8 @19 = private unnamed_addr constant [4 x i8] c"chan", align 1 @"map[chan _llgo_int]_llgo_int" = linkonce global ptr null, align 8 -@_llgo_main.M = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.M" = linkonce global ptr null, align 8 @20 = private unnamed_addr constant [1 x i8] c"M", align 1 -@"map[_llgo_main.N]_llgo_string" = linkonce global ptr null, align 8 +@"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N]_llgo_string" = linkonce global ptr null, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.make1() - call void @main.make2() - call void @main.make3() - call void @main.make4() - call void @main.make5() - call void @main.make6() - call void @main.make7() - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make1"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make2"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make3"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make4"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make5"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make6"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make7"() + ret void } -define void @main.make1() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make1"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = load ptr, ptr @_llgo_string, align 8 @@ -278,7 +272,7 @@ _llgo_16: ; preds = %_llgo_15, %_llgo_14 br i1 %97, label %_llgo_5, label %_llgo_6 } -define void @main.make2() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make2"() { _llgo_0: %0 = load ptr, ptr @"map[_llgo_int]_llgo_string", align 8 %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %0, i64 0) @@ -310,7 +304,7 @@ _llgo_0: %10 = getelementptr inbounds i64, ptr %9, i64 0 store i64 1, ptr %10, align 4 %11 = load [1 x i64], ptr %9, align 4 - %12 = load ptr, ptr @_llgo_main.N1, align 8 + %12 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N1", align 8 %13 = extractvalue [1 x i64] %11, 0 %14 = inttoptr i64 %13 to ptr %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %12, 0 @@ -325,7 +319,7 @@ _llgo_0: %21 = getelementptr inbounds i64, ptr %20, i64 0 store i64 2, ptr %21, align 4 %22 = load [1 x i64], ptr %20, align 4 - %23 = load ptr, ptr @_llgo_main.N1, align 8 + %23 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N1", align 8 %24 = extractvalue [1 x i64] %22, 0 %25 = inttoptr i64 %24 to ptr %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %23, 0 @@ -340,7 +334,7 @@ _llgo_0: %32 = getelementptr inbounds i64, ptr %31, i64 0 store i64 3, ptr %32, align 4 %33 = load [1 x i64], ptr %31, align 4 - %34 = load ptr, ptr @_llgo_main.N1, align 8 + %34 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N1", align 8 %35 = extractvalue [1 x i64] %33, 0 %36 = inttoptr i64 %35 to ptr %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %34, 0 @@ -355,7 +349,7 @@ _llgo_0: %43 = getelementptr inbounds i64, ptr %42, i64 0 store i64 2, ptr %43, align 4 %44 = load [1 x i64], ptr %42, align 4 - %45 = load ptr, ptr @_llgo_main.N1, align 8 + %45 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N1", align 8 %46 = extractvalue [1 x i64] %44, 0 %47 = inttoptr i64 %46 to ptr %48 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %45, 0 @@ -378,7 +372,7 @@ _llgo_2: ; preds = %_llgo_6 %57 = extractvalue { i1, %"github.com/goplus/llgo/runtime/internal/runtime.eface", i64 } %68, 1 %58 = extractvalue { i1, %"github.com/goplus/llgo/runtime/internal/runtime.eface", i64 } %68, 2 %59 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %57, 0 - %60 = load ptr, ptr @_llgo_main.N1, align 8 + %60 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N1", align 8 %61 = icmp eq ptr %59, %60 br i1 %61, label %_llgo_7, label %_llgo_8 @@ -421,32 +415,32 @@ _llgo_8: ; preds = %_llgo_2 unreachable } -define void @main.make3() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make3"() { _llgo_0: - %0 = alloca [1 x %main.N], align 8 + %0 = alloca [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], align 8 call void @llvm.memset(ptr %0, i8 0, i64 2, i1 false) - %1 = getelementptr inbounds %main.N, ptr %0, i64 0 - %2 = getelementptr inbounds %main.N, ptr %1, i32 0, i32 0 - %3 = getelementptr inbounds %main.N, ptr %1, i32 0, i32 1 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %0, i64 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %1, i32 0, i32 0 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %1, i32 0, i32 1 store i8 1, ptr %2, align 1 store i8 2, ptr %3, align 1 - %4 = load [1 x %main.N], ptr %0, align 1 - %5 = load ptr, ptr @_llgo_main.K, align 8 + %4 = load [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], ptr %0, align 1 + %5 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K", align 8 %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 2) - store [1 x %main.N] %4, ptr %6, align 1 + store [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"] %4, ptr %6, align 1 %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %5, 0 %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr %6, 1 - %9 = alloca [1 x %main.N], align 8 + %9 = alloca [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], align 8 call void @llvm.memset(ptr %9, i8 0, i64 2, i1 false) - %10 = getelementptr inbounds %main.N, ptr %9, i64 0 - %11 = getelementptr inbounds %main.N, ptr %10, i32 0, i32 0 - %12 = getelementptr inbounds %main.N, ptr %10, i32 0, i32 1 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %9, i64 0 + %11 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %10, i32 0, i32 0 + %12 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %10, i32 0, i32 1 store i8 1, ptr %11, align 1 store i8 2, ptr %12, align 1 - %13 = load [1 x %main.N], ptr %9, align 1 - %14 = load ptr, ptr @_llgo_main.K, align 8 + %13 = load [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], ptr %9, align 1 + %14 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K", align 8 %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 2) - store [1 x %main.N] %13, ptr %15, align 1 + store [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"] %13, ptr %15, align 1 %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %14, 0 %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %16, ptr %15, 1 %18 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %17) @@ -454,17 +448,17 @@ _llgo_0: call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) %19 = load ptr, ptr @"map[_llgo_any]_llgo_int", align 8 %20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %19, i64 0) - %21 = alloca [1 x %main.N], align 8 + %21 = alloca [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], align 8 call void @llvm.memset(ptr %21, i8 0, i64 2, i1 false) - %22 = getelementptr inbounds %main.N, ptr %21, i64 0 - %23 = getelementptr inbounds %main.N, ptr %22, i32 0, i32 0 - %24 = getelementptr inbounds %main.N, ptr %22, i32 0, i32 1 + %22 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %21, i64 0 + %23 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %22, i32 0, i32 0 + %24 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %22, i32 0, i32 1 store i8 1, ptr %23, align 1 store i8 2, ptr %24, align 1 - %25 = load [1 x %main.N], ptr %21, align 1 - %26 = load ptr, ptr @_llgo_main.K, align 8 + %25 = load [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], ptr %21, align 1 + %26 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K", align 8 %27 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 2) - store [1 x %main.N] %25, ptr %27, align 1 + store [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"] %25, ptr %27, align 1 %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %26, 0 %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %28, ptr %27, 1 %30 = load ptr, ptr @"map[_llgo_any]_llgo_int", align 8 @@ -472,17 +466,17 @@ _llgo_0: store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %29, ptr %31, align 8 %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %30, ptr %20, ptr %31) store i64 100, ptr %32, align 4 - %33 = alloca [1 x %main.N], align 8 + %33 = alloca [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], align 8 call void @llvm.memset(ptr %33, i8 0, i64 2, i1 false) - %34 = getelementptr inbounds %main.N, ptr %33, i64 0 - %35 = getelementptr inbounds %main.N, ptr %34, i32 0, i32 0 - %36 = getelementptr inbounds %main.N, ptr %34, i32 0, i32 1 + %34 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %33, i64 0 + %35 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %34, i32 0, i32 0 + %36 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %34, i32 0, i32 1 store i8 3, ptr %35, align 1 store i8 4, ptr %36, align 1 - %37 = load [1 x %main.N], ptr %33, align 1 - %38 = load ptr, ptr @_llgo_main.K, align 8 + %37 = load [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], ptr %33, align 1 + %38 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K", align 8 %39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 2) - store [1 x %main.N] %37, ptr %39, align 1 + store [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"] %37, ptr %39, align 1 %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %38, 0 %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %40, ptr %39, 1 %42 = load ptr, ptr @"map[_llgo_any]_llgo_int", align 8 @@ -503,7 +497,7 @@ _llgo_2: ; preds = %_llgo_6 %49 = extractvalue { i1, %"github.com/goplus/llgo/runtime/internal/runtime.eface", i64 } %60, 1 %50 = extractvalue { i1, %"github.com/goplus/llgo/runtime/internal/runtime.eface", i64 } %60, 2 %51 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %49, 0 - %52 = load ptr, ptr @_llgo_main.K, align 8 + %52 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K", align 8 %53 = icmp eq ptr %51, %52 br i1 %53, label %_llgo_7, label %_llgo_8 @@ -529,13 +523,13 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 _llgo_7: ; preds = %_llgo_2 %62 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %49, 1 - %63 = load [1 x %main.N], ptr %62, align 1 - %64 = alloca [1 x %main.N], align 8 + %63 = load [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], ptr %62, align 1 + %64 = alloca [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"], align 8 call void @llvm.memset(ptr %64, i8 0, i64 2, i1 false) - store [1 x %main.N] %63, ptr %64, align 1 - %65 = getelementptr inbounds %main.N, ptr %64, i64 0 - %66 = load %main.N, ptr %65, align 1 - %67 = extractvalue %main.N %66, 0 + store [1 x %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N"] %63, ptr %64, align 1 + %65 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %64, i64 0 + %66 = load %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %65, align 1 + %67 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N" %66, 0 %68 = sext i8 %67 to i64 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %68) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -553,19 +547,19 @@ _llgo_8: ; preds = %_llgo_2 unreachable } -define void @main.make4() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make4"() { _llgo_0: %0 = alloca [1 x ptr], align 8 call void @llvm.memset(ptr %0, i8 0, i64 8, i1 false) %1 = getelementptr inbounds ptr, ptr %0, i64 0 %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 2) - %3 = getelementptr inbounds %main.N, ptr %2, i32 0, i32 0 - %4 = getelementptr inbounds %main.N, ptr %2, i32 0, i32 1 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %2, i32 0, i32 0 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %2, i32 0, i32 1 store i8 1, ptr %3, align 1 store i8 2, ptr %4, align 1 store ptr %2, ptr %1, align 8 %5 = load [1 x ptr], ptr %0, align 8 - %6 = load ptr, ptr @_llgo_main.K2, align 8 + %6 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K2", align 8 %7 = extractvalue [1 x ptr] %5, 0 %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %6, 0 %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, ptr %7, 1 @@ -573,13 +567,13 @@ _llgo_0: call void @llvm.memset(ptr %10, i8 0, i64 8, i1 false) %11 = getelementptr inbounds ptr, ptr %10, i64 0 %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 2) - %13 = getelementptr inbounds %main.N, ptr %12, i32 0, i32 0 - %14 = getelementptr inbounds %main.N, ptr %12, i32 0, i32 1 + %13 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %12, i32 0, i32 0 + %14 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %12, i32 0, i32 1 store i8 1, ptr %13, align 1 store i8 2, ptr %14, align 1 store ptr %12, ptr %11, align 8 %15 = load [1 x ptr], ptr %10, align 8 - %16 = load ptr, ptr @_llgo_main.K2, align 8 + %16 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K2", align 8 %17 = extractvalue [1 x ptr] %15, 0 %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %16, 0 %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %18, ptr %17, 1 @@ -592,13 +586,13 @@ _llgo_0: call void @llvm.memset(ptr %23, i8 0, i64 8, i1 false) %24 = getelementptr inbounds ptr, ptr %23, i64 0 %25 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 2) - %26 = getelementptr inbounds %main.N, ptr %25, i32 0, i32 0 - %27 = getelementptr inbounds %main.N, ptr %25, i32 0, i32 1 + %26 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %25, i32 0, i32 0 + %27 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %25, i32 0, i32 1 store i8 1, ptr %26, align 1 store i8 2, ptr %27, align 1 store ptr %25, ptr %24, align 8 %28 = load [1 x ptr], ptr %23, align 8 - %29 = load ptr, ptr @_llgo_main.K2, align 8 + %29 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K2", align 8 %30 = extractvalue [1 x ptr] %28, 0 %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %29, 0 %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %31, ptr %30, 1 @@ -611,13 +605,13 @@ _llgo_0: call void @llvm.memset(ptr %36, i8 0, i64 8, i1 false) %37 = getelementptr inbounds ptr, ptr %36, i64 0 %38 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 2) - %39 = getelementptr inbounds %main.N, ptr %38, i32 0, i32 0 - %40 = getelementptr inbounds %main.N, ptr %38, i32 0, i32 1 + %39 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %38, i32 0, i32 0 + %40 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %38, i32 0, i32 1 store i8 3, ptr %39, align 1 store i8 4, ptr %40, align 1 store ptr %38, ptr %37, align 8 %41 = load [1 x ptr], ptr %36, align 8 - %42 = load ptr, ptr @_llgo_main.K2, align 8 + %42 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K2", align 8 %43 = extractvalue [1 x ptr] %41, 0 %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %42, 0 %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %44, ptr %43, 1 @@ -639,7 +633,7 @@ _llgo_2: ; preds = %_llgo_6 %53 = extractvalue { i1, %"github.com/goplus/llgo/runtime/internal/runtime.eface", i64 } %64, 1 %54 = extractvalue { i1, %"github.com/goplus/llgo/runtime/internal/runtime.eface", i64 } %64, 2 %55 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %53, 0 - %56 = load ptr, ptr @_llgo_main.K2, align 8 + %56 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K2", align 8 %57 = icmp eq ptr %55, %56 br i1 %57, label %_llgo_7, label %_llgo_8 @@ -665,7 +659,7 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 _llgo_7: ; preds = %_llgo_2 %66 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %53, 1 - %67 = getelementptr inbounds %main.N, ptr %66, i32 0, i32 0 + %67 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", ptr %66, i32 0, i32 0 %68 = load i8, ptr %67, align 1 %69 = sext i8 %68 to i64 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %69) @@ -684,7 +678,7 @@ _llgo_8: ; preds = %_llgo_2 unreachable } -define void @main.make5() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make5"() { _llgo_0: %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewChan"(i64 8, i64 0) %1 = load ptr, ptr @"chan _llgo_int", align 8 @@ -748,16 +742,16 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 br i1 %30, label %_llgo_2, label %_llgo_3 } -define void @main.make6() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make6"() { _llgo_0: %0 = load ptr, ptr @"map[_llgo_int]_llgo_string", align 8 %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %0, i64 0) - %2 = load ptr, ptr @_llgo_main.M, align 8 + %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.M", align 8 %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) store i64 1, ptr %3, align 4 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %2, ptr %1, ptr %3) store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 5 }, ptr %4, align 8 - %5 = load ptr, ptr @_llgo_main.M, align 8 + %5 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.M", align 8 %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewMapIter"(ptr %5, ptr %1) br label %_llgo_1 @@ -796,22 +790,22 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 br i1 %18, label %_llgo_2, label %_llgo_3 } -define void @main.make7() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.make7"() { _llgo_0: - %0 = load ptr, ptr @_llgo_main.N, align 8 - %1 = load ptr, ptr @"map[_llgo_main.N]_llgo_string", align 8 + %0 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 + %1 = load ptr, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N]_llgo_string", align 8 %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %1, i64 2) - %3 = load ptr, ptr @"map[_llgo_main.N]_llgo_string", align 8 + %3 = load ptr, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N]_llgo_string", align 8 %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) store i64 1, ptr %4, align 4 %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %3, ptr %2, ptr %4) store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 5 }, ptr %5, align 8 - %6 = load ptr, ptr @"map[_llgo_main.N]_llgo_string", align 8 + %6 = load ptr, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N]_llgo_string", align 8 %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) store i64 2, ptr %7, align 4 %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %6, ptr %2, ptr %7) store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 5 }, ptr %8, align 8 - %9 = load ptr, ptr @"map[_llgo_main.N]_llgo_string", align 8 + %9 = load ptr, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N]_llgo_string", align 8 %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewMapIter"(ptr %9, ptr %2) br label %_llgo_1 @@ -830,7 +824,7 @@ _llgo_2: ; preds = %_llgo_6 br label %_llgo_1 _llgo_3: ; preds = %_llgo_6 - %15 = load ptr, ptr @"map[_llgo_main.N]_llgo_string", align 8 + %15 = load ptr, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N]_llgo_string", align 8 %16 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) store i64 1, ptr %16, align 4 %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAccess1"(ptr %15, ptr %2, ptr %16) @@ -857,9 +851,7 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 br i1 %26, label %_llgo_2, label %_llgo_3 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = icmp eq ptr %0, null @@ -911,7 +903,7 @@ _llgo_5: ; preds = %_llgo_4 %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %21, 0 %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %26, i64 4, 1 %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27, i64 4, 2 - %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28) + %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28) %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %8, ptr %9, ptr %29, i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %30) store ptr %30, ptr @"map[_llgo_int]_llgo_string", align 8 @@ -948,7 +940,7 @@ _llgo_7: ; preds = %_llgo_6 %51 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %46, 0 %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %51, i64 4, 1 %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %52, i64 4, 2 - %54 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %53) + %54 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %53) %55 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %33, ptr %34, ptr %54, i64 12) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %55) store ptr %55, ptr @"map[_llgo_string]_llgo_int", align 8 @@ -964,7 +956,7 @@ _llgo_9: ; preds = %_llgo_8 %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %58, 0 %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59, i64 0, 1 %61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, i64 0, 2 - %62 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61) + %62 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61) store ptr %62, ptr @_llgo_any, align 8 br label %_llgo_10 @@ -978,7 +970,7 @@ _llgo_11: ; preds = %_llgo_10 %66 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %65, 0 %67 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %66, i64 0, 1 %68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %67, i64 0, 2 - %69 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68) + %69 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68) %70 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34) %71 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 40) %72 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %71) @@ -987,7 +979,7 @@ _llgo_11: ; preds = %_llgo_10 %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %74, 0 %76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75, i64 0, 1 %77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76, i64 0, 2 - %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77) + %78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77) %79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %78) %80 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, ptr %79, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34) @@ -1007,20 +999,20 @@ _llgo_11: ; preds = %_llgo_10 %91 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %86, 0 %92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %91, i64 4, 1 %93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %92, i64 4, 2 - %94 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %93) + %94 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %93) %95 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %69, ptr %70, ptr %94, i64 24) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %95) store ptr %95, ptr @"map[_llgo_any]_llgo_int", align 8 br label %_llgo_12 _llgo_12: ; preds = %_llgo_11, %_llgo_10 - %96 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 2 }, i64 17, i64 8, i64 0, i64 0) - %97 = load ptr, ptr @_llgo_main.N1, align 8 + %96 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 2 }, i64 17, i64 8, i64 0, i64 0) + %97 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N1", align 8 %98 = icmp eq ptr %97, null br i1 %98, label %_llgo_13, label %_llgo_14 _llgo_13: ; preds = %_llgo_12 - store ptr %96, ptr @_llgo_main.N1, align 8 + store ptr %96, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N1", align 8 br label %_llgo_14 _llgo_14: ; preds = %_llgo_13, %_llgo_12 @@ -1043,23 +1035,23 @@ _llgo_17: ; preds = %_llgo_16 br label %_llgo_18 _llgo_18: ; preds = %_llgo_17, %_llgo_16 - %104 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 1 }, i64 17, i64 2, i64 0, i64 0) - %105 = load ptr, ptr @_llgo_main.K, align 8 + %104 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 1 }, i64 17, i64 2, i64 0, i64 0) + %105 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K", align 8 %106 = icmp eq ptr %105, null br i1 %106, label %_llgo_19, label %_llgo_20 _llgo_19: ; preds = %_llgo_18 - store ptr %104, ptr @_llgo_main.K, align 8 + store ptr %104, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K", align 8 br label %_llgo_20 _llgo_20: ; preds = %_llgo_19, %_llgo_18 - %107 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 25, i64 2, i64 0, i64 0) - %108 = load ptr, ptr @_llgo_main.N, align 8 + %107 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 25, i64 2, i64 0, i64 0) + %108 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 %109 = icmp eq ptr %108, null br i1 %109, label %_llgo_21, label %_llgo_22 _llgo_21: ; preds = %_llgo_20 - store ptr %107, ptr @_llgo_main.N, align 8 + store ptr %107, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 br label %_llgo_22 _llgo_22: ; preds = %_llgo_21, %_llgo_20 @@ -1086,9 +1078,9 @@ _llgo_24: ; preds = %_llgo_23, %_llgo_22 %121 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %118, 0 %122 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %121, i64 2, 1 %123 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %122, i64 2, 2 - %124 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 2, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %123) - store ptr %124, ptr @"main.struct$e65EDK9vxC36Nz3YTgO1ulssLlNH03Bva_WWaCjH-4A", align 8 - %125 = load ptr, ptr @"main.struct$e65EDK9vxC36Nz3YTgO1ulssLlNH03Bva_WWaCjH-4A", align 8 + %124 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, i64 2, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %123) + store ptr %124, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.struct$e65EDK9vxC36Nz3YTgO1ulssLlNH03Bva_WWaCjH-4A", align 8 + %125 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/makemap.struct$e65EDK9vxC36Nz3YTgO1ulssLlNH03Bva_WWaCjH-4A", align 8 br i1 %109, label %_llgo_25, label %_llgo_26 _llgo_25: ; preds = %_llgo_24 @@ -1096,19 +1088,19 @@ _llgo_25: ; preds = %_llgo_24 br label %_llgo_26 _llgo_26: ; preds = %_llgo_25, %_llgo_24 - %126 = load ptr, ptr @_llgo_main.N, align 8 - %127 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 25, i64 2, i64 0, i64 0) - %128 = load ptr, ptr @"[1]_llgo_main.N", align 8 + %126 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 + %127 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 25, i64 2, i64 0, i64 0) + %128 = load ptr, ptr @"[1]_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 %129 = icmp eq ptr %128, null br i1 %129, label %_llgo_27, label %_llgo_28 _llgo_27: ; preds = %_llgo_26 %130 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 1, ptr %127) - store ptr %130, ptr @"[1]_llgo_main.N", align 8 + store ptr %130, ptr @"[1]_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 br label %_llgo_28 _llgo_28: ; preds = %_llgo_27, %_llgo_26 - %131 = load ptr, ptr @"[1]_llgo_main.N", align 8 + %131 = load ptr, ptr @"[1]_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 br i1 %106, label %_llgo_29, label %_llgo_30 _llgo_29: ; preds = %_llgo_28 @@ -1116,32 +1108,32 @@ _llgo_29: ; preds = %_llgo_28 br label %_llgo_30 _llgo_30: ; preds = %_llgo_29, %_llgo_28 - %132 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @18, i64 2 }, i64 17, i64 8, i64 0, i64 0) - %133 = load ptr, ptr @_llgo_main.K2, align 8 + %132 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @18, i64 2 }, i64 17, i64 8, i64 0, i64 0) + %133 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K2", align 8 %134 = icmp eq ptr %133, null br i1 %134, label %_llgo_31, label %_llgo_32 _llgo_31: ; preds = %_llgo_30 call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %132) - store ptr %132, ptr @_llgo_main.K2, align 8 + store ptr %132, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.K2", align 8 br label %_llgo_32 _llgo_32: ; preds = %_llgo_31, %_llgo_30 - %135 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 25, i64 2, i64 0, i64 0) - %136 = load ptr, ptr @"*_llgo_main.N", align 8 + %135 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 25, i64 2, i64 0, i64 0) + %136 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 %137 = icmp eq ptr %136, null br i1 %137, label %_llgo_33, label %_llgo_34 _llgo_33: ; preds = %_llgo_32 %138 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %135) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %138) - store ptr %138, ptr @"*_llgo_main.N", align 8 + store ptr %138, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 br label %_llgo_34 _llgo_34: ; preds = %_llgo_33, %_llgo_32 - %139 = load ptr, ptr @"*_llgo_main.N", align 8 - %140 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 25, i64 2, i64 0, i64 0) - %141 = load ptr, ptr @"[1]*_llgo_main.N", align 8 + %139 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 + %140 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 25, i64 2, i64 0, i64 0) + %141 = load ptr, ptr @"[1]*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 %142 = icmp eq ptr %141, null br i1 %142, label %_llgo_35, label %_llgo_36 @@ -1149,11 +1141,11 @@ _llgo_35: ; preds = %_llgo_34 %143 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %140) %144 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 1, ptr %143) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %144) - store ptr %144, ptr @"[1]*_llgo_main.N", align 8 + store ptr %144, ptr @"[1]*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 br label %_llgo_36 _llgo_36: ; preds = %_llgo_35, %_llgo_34 - %145 = load ptr, ptr @"[1]*_llgo_main.N", align 8 + %145 = load ptr, ptr @"[1]*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N", align 8 br i1 %134, label %_llgo_37, label %_llgo_38 _llgo_37: ; preds = %_llgo_36 @@ -1205,21 +1197,21 @@ _llgo_41: ; preds = %_llgo_40 %172 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %167, 0 %173 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %172, i64 4, 1 %174 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %173, i64 4, 2 - %175 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 144, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %174) + %175 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, i64 144, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %174) %176 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %153, ptr %154, ptr %175, i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %176) store ptr %176, ptr @"map[chan _llgo_int]_llgo_int", align 8 br label %_llgo_42 _llgo_42: ; preds = %_llgo_41, %_llgo_40 - %177 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @20, i64 1 }, i64 21, i64 8, i64 0, i64 0) - %178 = load ptr, ptr @_llgo_main.M, align 8 + %177 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @20, i64 1 }, i64 21, i64 8, i64 0, i64 0) + %178 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.M", align 8 %179 = icmp eq ptr %178, null br i1 %179, label %_llgo_43, label %_llgo_44 _llgo_43: ; preds = %_llgo_42 call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %177) - store ptr %177, ptr @_llgo_main.M, align 8 + store ptr %177, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.M", align 8 br label %_llgo_44 _llgo_44: ; preds = %_llgo_43, %_llgo_42 @@ -1231,9 +1223,9 @@ _llgo_45: ; preds = %_llgo_44 br label %_llgo_46 _llgo_46: ; preds = %_llgo_45, %_llgo_44 - %181 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 2, i64 8, i64 0, i64 0) - %182 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 2, i64 8, i64 0, i64 0) - %183 = load ptr, ptr @"map[_llgo_main.N]_llgo_string", align 8 + %181 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 2, i64 8, i64 0, i64 0) + %182 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 1 }, i64 2, i64 8, i64 0, i64 0) + %183 = load ptr, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N]_llgo_string", align 8 %184 = icmp eq ptr %183, null br i1 %184, label %_llgo_47, label %_llgo_48 @@ -1261,10 +1253,10 @@ _llgo_47: ; preds = %_llgo_46 %201 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %196, 0 %202 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %201, i64 4, 1 %203 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %202, i64 4, 2 - %204 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %203) + %204 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 50 }, i64 208, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %203) %205 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %181, ptr %185, ptr %204, i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %205) - store ptr %205, ptr @"map[_llgo_main.N]_llgo_string", align 8 + store ptr %205, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/makemap.N]_llgo_string", align 8 br label %_llgo_48 _llgo_48: ; preds = %_llgo_47, %_llgo_46 diff --git a/compiler/cl/_testrt/map/out.ll b/compiler/cl/_testrt/map/out.ll index 6127be8a..3c271056 100644 --- a/compiler/cl/_testrt/map/out.ll +++ b/compiler/cl/_testrt/map/out.ll @@ -1,67 +1,59 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/map' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/map" %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/map.init$guard" = global i1 false, align 1 @_llgo_int = linkonce global ptr null, align 8 @"map[_llgo_int]_llgo_int" = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [7 x i8] c"topbits", align 1 @1 = private unnamed_addr constant [4 x i8] c"keys", align 1 @2 = private unnamed_addr constant [5 x i8] c"elems", align 1 @3 = private unnamed_addr constant [8 x i8] c"overflow", align 1 -@4 = private unnamed_addr constant [4 x i8] c"main", align 1 +@4 = private unnamed_addr constant [46 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/map", align 1 @5 = private unnamed_addr constant [10 x i8] c"Hello %d\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/map.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/map.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/map.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/map.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/map.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @_llgo_int, align 8 + %0 = load ptr, ptr @_llgo_int, align 8 + %1 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8 + %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %1, i64 2) %3 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8 - %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %3, i64 2) - %5 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8 - %6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - store i64 23, ptr %6, align 4 - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %5, ptr %4, ptr %6) - store i64 100, ptr %7, align 4 - %8 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8 - %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - store i64 7, ptr %9, align 4 - %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %8, ptr %4, ptr %9) - store i64 29, ptr %10, align 4 - %11 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8 - %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - store i64 23, ptr %12, align 4 - %13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAccess1"(ptr %11, ptr %4, ptr %12) - %14 = load i64, ptr %13, align 4 - %15 = call i32 (ptr, ...) @printf(ptr @5, i64 %14) - ret i32 0 + %4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + store i64 23, ptr %4, align 4 + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %3, ptr %2, ptr %4) + store i64 100, ptr %5, align 4 + %6 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8 + %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + store i64 7, ptr %7, align 4 + %8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %6, ptr %2, ptr %7) + store i64 29, ptr %8, align 4 + %9 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8 + %10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + store i64 23, ptr %10, align 4 + %11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAccess1"(ptr %9, ptr %2, ptr %10) + %12 = load i64, ptr %11, align 4 + %13 = call i32 (ptr, ...) @printf(ptr @5, i64 %12) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/map.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_int, align 8 %1 = icmp eq ptr %0, null @@ -103,7 +95,7 @@ _llgo_3: ; preds = %_llgo_2 %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %18, 0 %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %23, i64 4, 1 %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %24, i64 4, 2 - %26 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 144, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %25) + %26 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 46 }, i64 144, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %25) %27 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %5, ptr %6, ptr %26, i64 4) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %27) store ptr %27, ptr @"map[_llgo_int]_llgo_int", align 8 diff --git a/compiler/cl/_testrt/mask/out.ll b/compiler/cl/_testrt/mask/out.ll index 96f65e87..53e16b2e 100644 --- a/compiler/cl/_testrt/mask/out.ll +++ b/compiler/cl/_testrt/mask/out.ll @@ -1,71 +1,65 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/mask' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/mask" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/mask.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/mask.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/mask.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/mask.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/mask.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call i32 @main.mask(i8 1) - %3 = sext i32 %2 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %3) + %0 = call i32 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask"(i8 1) + %1 = sext i32 %0 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %1) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %4 = call i64 @main.mask_shl(i64 127, i64 5) + %2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shl"(i64 127, i64 5) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %2) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) + %3 = call i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shl8"(i8 127, i64 5) + %4 = sext i8 %3 to i64 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %4) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %5 = call i8 @main.mask_shl8(i8 127, i64 5) - %6 = sext i8 %5 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %6) + %5 = call i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shl8u"(i8 127, i64 5) + %6 = zext i8 %5 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %6) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %7 = call i8 @main.mask_shl8u(i8 127, i64 5) - %8 = zext i8 %7 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %8) + %7 = call i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shl8"(i8 127, i64 16) + %8 = sext i8 %7 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %8) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %9 = call i8 @main.mask_shl8(i8 127, i64 16) - %10 = sext i8 %9 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %10) + %9 = call i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shl8u"(i8 127, i64 16) + %10 = zext i8 %9 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %10) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %11 = call i8 @main.mask_shl8u(i8 127, i64 16) - %12 = zext i8 %11 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %12) + %11 = call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shr"(i64 127, i64 5) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %11) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %13 = call i64 @main.mask_shr(i64 127, i64 5) + %12 = call i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shr8"(i8 127, i64 5) + %13 = sext i8 %12 to i64 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %13) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %14 = call i8 @main.mask_shr8(i8 127, i64 5) - %15 = sext i8 %14 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %15) + %14 = call i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shr8u"(i8 127, i64 5) + %15 = zext i8 %14 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %15) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %16 = call i8 @main.mask_shr8u(i8 127, i64 5) - %17 = zext i8 %16 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 %17) + %16 = call i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shr8"(i8 127, i64 16) + %17 = sext i8 %16 to i64 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %17) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %18 = call i8 @main.mask_shr8(i8 127, i64 16) - %19 = sext i8 %18 to i64 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %19) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -define i32 @main.mask(i8 %0) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask"(i8 %0) { _llgo_0: %1 = sext i8 %0 to i32 %2 = shl i32 %1, 31 @@ -74,7 +68,7 @@ _llgo_0: ret i32 %4 } -define i64 @main.mask_shl(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shl"(i64 %0, i64 %1) { _llgo_0: %2 = icmp slt i64 %1, 0 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertNegativeShift"(i1 %2) @@ -84,7 +78,7 @@ _llgo_0: ret i64 %5 } -define i8 @main.mask_shl8(i8 %0, i64 %1) { +define i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shl8"(i8 %0, i64 %1) { _llgo_0: %2 = icmp slt i64 %1, 0 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertNegativeShift"(i1 %2) @@ -95,7 +89,7 @@ _llgo_0: ret i8 %6 } -define i8 @main.mask_shl8u(i8 %0, i64 %1) { +define i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shl8u"(i8 %0, i64 %1) { _llgo_0: %2 = icmp slt i64 %1, 0 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertNegativeShift"(i1 %2) @@ -106,7 +100,7 @@ _llgo_0: ret i8 %6 } -define i64 @main.mask_shr(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shr"(i64 %0, i64 %1) { _llgo_0: %2 = icmp slt i64 %1, 0 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertNegativeShift"(i1 %2) @@ -116,7 +110,7 @@ _llgo_0: ret i64 %5 } -define i8 @main.mask_shr8(i8 %0, i64 %1) { +define i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shr8"(i8 %0, i64 %1) { _llgo_0: %2 = icmp slt i64 %1, 0 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertNegativeShift"(i1 %2) @@ -127,7 +121,7 @@ _llgo_0: ret i8 %6 } -define i8 @main.mask_shr8u(i8 %0, i64 %1) { +define i8 @"github.com/goplus/llgo/compiler/cl/_testrt/mask.mask_shr8u"(i8 %0, i64 %1) { _llgo_0: %2 = icmp slt i64 %1, 0 call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertNegativeShift"(i1 %2) @@ -138,8 +132,6 @@ _llgo_0: ret i8 %6 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testrt/named/out.ll b/compiler/cl/_testrt/named/out.ll index 8dbacda6..ed814b34 100644 --- a/compiler/cl/_testrt/named/out.ll +++ b/compiler/cl/_testrt/named/out.ll @@ -1,136 +1,128 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/named' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/named" -%main.mspan = type { ptr, ptr, ptr, %main.minfo, i64, { ptr, ptr } } -%main.minfo = type { ptr, i64 } -%main.mSpanList = type { ptr, ptr } +%"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan" = type { ptr, ptr, ptr, %"github.com/goplus/llgo/compiler/cl/_testrt/named.minfo", i64, { ptr, ptr } } +%"github.com/goplus/llgo/compiler/cl/_testrt/named.minfo" = type { ptr, i64 } +%"github.com/goplus/llgo/compiler/cl/_testrt/named.mSpanList" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/named.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [19 x i8] c"%d %d %d %d %d %d\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/named.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/named.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/named.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/named.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 64) - store ptr %3, ptr %2, align 8 - %4 = load ptr, ptr %2, align 8 - %5 = getelementptr inbounds %main.mspan, ptr %4, i32 0, i32 4 - store i64 100, ptr %5, align 4 - %6 = load ptr, ptr %2, align 8 - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 64) - %8 = getelementptr inbounds %main.mspan, ptr %6, i32 0, i32 0 - store ptr %7, ptr %8, align 8 - %9 = load ptr, ptr %2, align 8 - %10 = getelementptr inbounds %main.mspan, ptr %9, i32 0, i32 0 - %11 = load ptr, ptr %10, align 8 - %12 = getelementptr inbounds %main.mspan, ptr %11, i32 0, i32 4 - store i64 200, ptr %12, align 4 - %13 = load ptr, ptr %2, align 8 - %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %15 = getelementptr inbounds %main.mspan, ptr %13, i32 0, i32 2 - store ptr %14, ptr %15, align 8 - %16 = load ptr, ptr %2, align 8 - %17 = getelementptr inbounds %main.mspan, ptr %16, i32 0, i32 2 - %18 = load ptr, ptr %17, align 8 - %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 64) - %20 = getelementptr inbounds %main.mSpanList, ptr %18, i32 0, i32 1 - store ptr %19, ptr %20, align 8 - %21 = load ptr, ptr %2, align 8 - %22 = getelementptr inbounds %main.mspan, ptr %21, i32 0, i32 2 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 64) + store ptr %1, ptr %0, align 8 + %2 = load ptr, ptr %0, align 8 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %2, i32 0, i32 4 + store i64 100, ptr %3, align 4 + %4 = load ptr, ptr %0, align 8 + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 64) + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %4, i32 0, i32 0 + store ptr %5, ptr %6, align 8 + %7 = load ptr, ptr %0, align 8 + %8 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %7, i32 0, i32 0 + %9 = load ptr, ptr %8, align 8 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %9, i32 0, i32 4 + store i64 200, ptr %10, align 4 + %11 = load ptr, ptr %0, align 8 + %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + %13 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %11, i32 0, i32 2 + store ptr %12, ptr %13, align 8 + %14 = load ptr, ptr %0, align 8 + %15 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %14, i32 0, i32 2 + %16 = load ptr, ptr %15, align 8 + %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 64) + %18 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mSpanList", ptr %16, i32 0, i32 1 + store ptr %17, ptr %18, align 8 + %19 = load ptr, ptr %0, align 8 + %20 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %19, i32 0, i32 2 + %21 = load ptr, ptr %20, align 8 + %22 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mSpanList", ptr %21, i32 0, i32 1 %23 = load ptr, ptr %22, align 8 - %24 = getelementptr inbounds %main.mSpanList, ptr %23, i32 0, i32 1 - %25 = load ptr, ptr %24, align 8 - %26 = getelementptr inbounds %main.mspan, ptr %25, i32 0, i32 4 - store i64 300, ptr %26, align 4 - %27 = load ptr, ptr %2, align 8 - %28 = getelementptr inbounds %main.mspan, ptr %27, i32 0, i32 3 - %29 = getelementptr inbounds %main.minfo, ptr %28, i32 0, i32 1 - store i64 10, ptr %29, align 4 - %30 = load ptr, ptr %2, align 8 - %31 = getelementptr inbounds %main.mspan, ptr %30, i32 0, i32 3 - %32 = load ptr, ptr %2, align 8 - %33 = getelementptr inbounds %main.minfo, ptr %31, i32 0, i32 0 - store ptr %32, ptr %33, align 8 - %34 = load ptr, ptr %2, align 8 - %35 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) - %36 = getelementptr inbounds { ptr }, ptr %35, i32 0, i32 0 - store ptr %2, ptr %36, align 8 - %37 = insertvalue { ptr, ptr } { ptr @"main.main$1", ptr undef }, ptr %35, 1 - %38 = getelementptr inbounds %main.mspan, ptr %34, i32 0, i32 5 - store { ptr, ptr } %37, ptr %38, align 8 - %39 = load ptr, ptr %2, align 8 - %40 = getelementptr inbounds %main.mspan, ptr %39, i32 0, i32 0 - %41 = load ptr, ptr %40, align 8 - %42 = getelementptr inbounds %main.mspan, ptr %41, i32 0, i32 4 - %43 = load i64, ptr %42, align 4 - %44 = load ptr, ptr %2, align 8 - %45 = getelementptr inbounds %main.mspan, ptr %44, i32 0, i32 2 + %24 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %23, i32 0, i32 4 + store i64 300, ptr %24, align 4 + %25 = load ptr, ptr %0, align 8 + %26 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %25, i32 0, i32 3 + %27 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.minfo", ptr %26, i32 0, i32 1 + store i64 10, ptr %27, align 4 + %28 = load ptr, ptr %0, align 8 + %29 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %28, i32 0, i32 3 + %30 = load ptr, ptr %0, align 8 + %31 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.minfo", ptr %29, i32 0, i32 0 + store ptr %30, ptr %31, align 8 + %32 = load ptr, ptr %0, align 8 + %33 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) + %34 = getelementptr inbounds { ptr }, ptr %33, i32 0, i32 0 + store ptr %0, ptr %34, align 8 + %35 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/named.main$1", ptr undef }, ptr %33, 1 + %36 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %32, i32 0, i32 5 + store { ptr, ptr } %35, ptr %36, align 8 + %37 = load ptr, ptr %0, align 8 + %38 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %37, i32 0, i32 0 + %39 = load ptr, ptr %38, align 8 + %40 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %39, i32 0, i32 4 + %41 = load i64, ptr %40, align 4 + %42 = load ptr, ptr %0, align 8 + %43 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %42, i32 0, i32 2 + %44 = load ptr, ptr %43, align 8 + %45 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mSpanList", ptr %44, i32 0, i32 1 %46 = load ptr, ptr %45, align 8 - %47 = getelementptr inbounds %main.mSpanList, ptr %46, i32 0, i32 1 - %48 = load ptr, ptr %47, align 8 - %49 = getelementptr inbounds %main.mspan, ptr %48, i32 0, i32 4 - %50 = load i64, ptr %49, align 4 - %51 = load ptr, ptr %2, align 8 - %52 = getelementptr inbounds %main.mspan, ptr %51, i32 0, i32 3 - %53 = getelementptr inbounds %main.minfo, ptr %52, i32 0, i32 1 - %54 = load i64, ptr %53, align 4 - %55 = load ptr, ptr %2, align 8 - %56 = getelementptr inbounds %main.mspan, ptr %55, i32 0, i32 3 - %57 = getelementptr inbounds %main.minfo, ptr %56, i32 0, i32 0 - %58 = load ptr, ptr %57, align 8 - %59 = getelementptr inbounds %main.mspan, ptr %58, i32 0, i32 4 - %60 = load i64, ptr %59, align 4 - %61 = load ptr, ptr %2, align 8 - %62 = getelementptr inbounds %main.mspan, ptr %61, i32 0, i32 5 - %63 = load { ptr, ptr }, ptr %62, align 8 - %64 = extractvalue { ptr, ptr } %63, 1 - %65 = extractvalue { ptr, ptr } %63, 0 - %66 = call i64 %65(ptr %64, i64 -2) - %67 = load ptr, ptr %2, align 8 - %68 = getelementptr inbounds %main.mspan, ptr %67, i32 0, i32 3 - %69 = getelementptr inbounds %main.minfo, ptr %68, i32 0, i32 0 - %70 = load ptr, ptr %69, align 8 - %71 = getelementptr inbounds %main.mspan, ptr %70, i32 0, i32 5 - %72 = load { ptr, ptr }, ptr %71, align 8 - %73 = extractvalue { ptr, ptr } %72, 1 - %74 = extractvalue { ptr, ptr } %72, 0 - %75 = call i64 %74(ptr %73, i64 -3) - %76 = call i32 (ptr, ...) @printf(ptr @0, i64 %43, i64 %50, i64 %54, i64 %60, i64 %66, i64 %75) - ret i32 0 + %47 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %46, i32 0, i32 4 + %48 = load i64, ptr %47, align 4 + %49 = load ptr, ptr %0, align 8 + %50 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %49, i32 0, i32 3 + %51 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.minfo", ptr %50, i32 0, i32 1 + %52 = load i64, ptr %51, align 4 + %53 = load ptr, ptr %0, align 8 + %54 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %53, i32 0, i32 3 + %55 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.minfo", ptr %54, i32 0, i32 0 + %56 = load ptr, ptr %55, align 8 + %57 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %56, i32 0, i32 4 + %58 = load i64, ptr %57, align 4 + %59 = load ptr, ptr %0, align 8 + %60 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %59, i32 0, i32 5 + %61 = load { ptr, ptr }, ptr %60, align 8 + %62 = extractvalue { ptr, ptr } %61, 1 + %63 = extractvalue { ptr, ptr } %61, 0 + %64 = call i64 %63(ptr %62, i64 -2) + %65 = load ptr, ptr %0, align 8 + %66 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %65, i32 0, i32 3 + %67 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.minfo", ptr %66, i32 0, i32 0 + %68 = load ptr, ptr %67, align 8 + %69 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %68, i32 0, i32 5 + %70 = load { ptr, ptr }, ptr %69, align 8 + %71 = extractvalue { ptr, ptr } %70, 1 + %72 = extractvalue { ptr, ptr } %70, 0 + %73 = call i64 %72(ptr %71, i64 -3) + %74 = call i32 (ptr, ...) @printf(ptr @0, i64 %41, i64 %48, i64 %52, i64 %58, i64 %64, i64 %73) + ret void } -define i64 @"main.main$1"(ptr %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/named.main$1"(ptr %0, i64 %1) { _llgo_0: %2 = load { ptr }, ptr %0, align 8 %3 = extractvalue { ptr } %2, 0 %4 = load ptr, ptr %3, align 8 - %5 = getelementptr inbounds %main.mspan, ptr %4, i32 0, i32 4 + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/named.mspan", ptr %4, i32 0, i32 4 %6 = load i64, ptr %5, align 4 %7 = mul i64 %6, %1 ret i64 %7 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64) diff --git a/compiler/cl/_testrt/namedslice/out.ll b/compiler/cl/_testrt/namedslice/out.ll index 75b499eb..085003c9 100644 --- a/compiler/cl/_testrt/namedslice/out.ll +++ b/compiler/cl/_testrt/namedslice/out.ll @@ -1,97 +1,89 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/namedslice' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/namedslice" %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -@_llgo_main.MyBytes = linkonce global ptr null, align 8 -@0 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/namedslice.init$guard" = global i1 false, align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/namedslice.MyBytes" = linkonce global ptr null, align 8 +@0 = private unnamed_addr constant [53 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/namedslice", align 1 @1 = private unnamed_addr constant [7 x i8] c"MyBytes", align 1 @_llgo_byte = linkonce global ptr null, align 8 @"[]_llgo_byte" = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [9 x i8] c"bad slice", align 1 @_llgo_string = linkonce global ptr null, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/namedslice.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/namedslice.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/namedslice.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/namedslice.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/namedslice.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 0) - %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0 - %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %3, i64 0, 1 - %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %4, i64 0, 2 - %6 = load ptr, ptr @_llgo_main.MyBytes, align 8 - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) - store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %5, ptr %7, align 8 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %6, 0 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, ptr %7, 1 - %10 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, 0 - %11 = load ptr, ptr @_llgo_main.MyBytes, align 8 - %12 = icmp eq ptr %10, %11 - br i1 %12, label %_llgo_3, label %_llgo_4 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 0) + %1 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0 + %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %1, i64 0, 1 + %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %2, i64 0, 2 + %4 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/namedslice.MyBytes", align 8 + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) + store %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %3, ptr %5, align 8 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr %5, 1 + %8 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, 0 + %9 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/namedslice.MyBytes", align 8 + %10 = icmp eq ptr %8, %9 + br i1 %10, label %_llgo_3, label %_llgo_4 _llgo_1: ; preds = %_llgo_5 - %13 = load ptr, ptr @_llgo_string, align 8 - %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 9 }, ptr %14, align 8 - %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %13, 0 - %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %15, ptr %14, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %16) + %11 = load ptr, ptr @_llgo_string, align 8 + %12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 9 }, ptr %12, align 8 + %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %11, 0 + %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, ptr %12, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %14) unreachable _llgo_2: ; preds = %_llgo_5 - ret i32 0 + ret void _llgo_3: ; preds = %_llgo_0 - %17 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, 1 - %18 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %17, align 8 - %19 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18, 0 - %20 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } %19, i1 true, 1 + %15 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, 1 + %16 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %15, align 8 + %17 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16, 0 + %18 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } %17, i1 true, 1 br label %_llgo_5 _llgo_4: ; preds = %_llgo_0 br label %_llgo_5 _llgo_5: ; preds = %_llgo_4, %_llgo_3 - %21 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } [ %20, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ] - %22 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } %21, 0 - %23 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } %21, 1 - br i1 %23, label %_llgo_2, label %_llgo_1 + %19 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } [ %18, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ] + %20 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } %19, 0 + %21 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } %19, 1 + br i1 %21, label %_llgo_2, label %_llgo_1 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/namedslice.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 7 }, i64 23, i64 24, i64 0, i64 0) - %1 = load ptr, ptr @_llgo_main.MyBytes, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 53 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 7 }, i64 23, i64 24, i64 0, i64 0) + %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/namedslice.MyBytes", align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %0, ptr @_llgo_main.MyBytes, align 8 + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/namedslice.MyBytes", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 diff --git a/compiler/cl/_testrt/panic/out.ll b/compiler/cl/_testrt/panic/out.ll index 196bc682..2389582a 100644 --- a/compiler/cl/_testrt/panic/out.ll +++ b/compiler/cl/_testrt/panic/out.ll @@ -1,47 +1,39 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/panic' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/panic" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/panic.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [13 x i8] c"panic message", align 1 @_llgo_string = linkonce global ptr null, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/panic.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/panic.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/panic.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/panic.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/panic.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @_llgo_string, align 8 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 13 }, ptr %3, align 8 - %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 - %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %4, ptr %3, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %5) + %0 = load ptr, ptr @_llgo_string, align 8 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 13 }, ptr %1, align 8 + %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 + %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, ptr %1, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %3) unreachable } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/panic.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_string, align 8 %1 = icmp eq ptr %0, null diff --git a/compiler/cl/_testrt/qsort/out.ll b/compiler/cl/_testrt/qsort/out.ll index 8f4b7ff4..fc1d2893 100644 --- a/compiler/cl/_testrt/qsort/out.ll +++ b/compiler/cl/_testrt/qsort/out.ll @@ -1,67 +1,61 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/qsort' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/qsort" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/qsort.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsort.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsort.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsort.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsort.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) - %3 = getelementptr inbounds i64, ptr %2, i64 0 - %4 = getelementptr inbounds i64, ptr %2, i64 1 - %5 = getelementptr inbounds i64, ptr %2, i64 2 - %6 = getelementptr inbounds i64, ptr %2, i64 3 - %7 = getelementptr inbounds i64, ptr %2, i64 4 - store i64 100, ptr %3, align 4 - store i64 8, ptr %4, align 4 - store i64 23, ptr %5, align 4 - store i64 2, ptr %6, align 4 - store i64 7, ptr %7, align 4 - %8 = getelementptr inbounds i64, ptr %2, i64 0 - call void @qsort(ptr %8, i64 5, i64 8, ptr @"main.main$1") - %9 = load [5 x i64], ptr %2, align 4 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) + %1 = getelementptr inbounds i64, ptr %0, i64 0 + %2 = getelementptr inbounds i64, ptr %0, i64 1 + %3 = getelementptr inbounds i64, ptr %0, i64 2 + %4 = getelementptr inbounds i64, ptr %0, i64 3 + %5 = getelementptr inbounds i64, ptr %0, i64 4 + store i64 100, ptr %1, align 4 + store i64 8, ptr %2, align 4 + store i64 23, ptr %3, align 4 + store i64 2, ptr %4, align 4 + store i64 7, ptr %5, align 4 + %6 = getelementptr inbounds i64, ptr %0, i64 0 + call void @qsort(ptr %6, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsort.main$1") + %7 = load [5 x i64], ptr %0, align 4 br label %_llgo_1 _llgo_1: ; preds = %_llgo_2, %_llgo_0 - %10 = phi i64 [ -1, %_llgo_0 ], [ %11, %_llgo_2 ] - %11 = add i64 %10, 1 - %12 = icmp slt i64 %11, 5 - br i1 %12, label %_llgo_2, label %_llgo_3 + %8 = phi i64 [ -1, %_llgo_0 ], [ %9, %_llgo_2 ] + %9 = add i64 %8, 1 + %10 = icmp slt i64 %9, 5 + br i1 %10, label %_llgo_2, label %_llgo_3 _llgo_2: ; preds = %_llgo_1 - %13 = icmp slt i64 %11, 0 - %14 = icmp sge i64 %11, 5 - %15 = or i1 %14, %13 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %15) - %16 = getelementptr inbounds i64, ptr %2, i64 %11 - %17 = load i64, ptr %16, align 4 - %18 = call i32 (ptr, ...) @printf(ptr @0, i64 %17) + %11 = icmp slt i64 %9, 0 + %12 = icmp sge i64 %9, 5 + %13 = or i1 %12, %11 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %13) + %14 = getelementptr inbounds i64, ptr %0, i64 %9 + %15 = load i64, ptr %14, align 4 + %16 = call i32 (ptr, ...) @printf(ptr @0, i64 %15) br label %_llgo_1 _llgo_3: ; preds = %_llgo_1 - ret i32 0 + ret void } -define i32 @"main.main$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsort.main$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -70,8 +64,6 @@ _llgo_0: ret i32 %5 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare void @qsort(ptr, i64, i64, ptr) diff --git a/compiler/cl/_testrt/qsortfn/out.ll b/compiler/cl/_testrt/qsortfn/out.ll index 80bc08eb..fbb2420b 100644 --- a/compiler/cl/_testrt/qsortfn/out.ll +++ b/compiler/cl/_testrt/qsortfn/out.ll @@ -1,9 +1,7 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/qsortfn' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/qsortfn" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [14 x i8] c"Comp => Comp\0A\00", align 1 @1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @2 = private unnamed_addr constant [12 x i8] c"fn => Comp\0A\00", align 1 @@ -25,39 +23,35 @@ source_filename = "main" @18 = private unnamed_addr constant [22 x i8] c"Comp => qsort.Comp()\0A\00", align 1 @19 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.sort1a() - call void @main.sort1b() - call void @main.sort2a() - call void @main.sort2b() - call void @main.sort3a() - call void @main.sort3b() - call void @main.sort4a() - call void @main.sort4b() - call void @main.sort5a() - call void @main.sort5b() - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort1a"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort1b"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort2a"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort2b"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort3a"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort3b"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort4a"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort4b"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort5a"() + call void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort5b"() + ret void } -define void @main.sort1a() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort1a"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @0) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -72,7 +66,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort1a$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort1a$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -96,7 +90,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort1a$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort1a$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -105,7 +99,7 @@ _llgo_0: ret i32 %5 } -define void @main.sort1b() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort1b"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @2) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -120,7 +114,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort1b$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort1b$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -144,7 +138,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort1b$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort1b$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -153,7 +147,7 @@ _llgo_0: ret i32 %5 } -define void @main.sort2a() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort2a"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @4) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -168,7 +162,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort2a$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort2a$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -192,7 +186,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort2a$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort2a$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -201,7 +195,7 @@ _llgo_0: ret i32 %5 } -define void @main.sort2b() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort2b"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @6) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -216,7 +210,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort2b$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort2b$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -240,7 +234,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort2b$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort2b$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -249,7 +243,7 @@ _llgo_0: ret i32 %5 } -define void @main.sort3a() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort3a"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @8) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -264,7 +258,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort3a$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort3a$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -288,7 +282,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort3a$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort3a$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -297,7 +291,7 @@ _llgo_0: ret i32 %5 } -define void @main.sort3b() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort3b"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @10) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -312,7 +306,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort3b$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort3b$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -336,7 +330,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort3b$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort3b$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -345,7 +339,7 @@ _llgo_0: ret i32 %5 } -define void @main.sort4a() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort4a"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @12) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -360,7 +354,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort4a$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort4a$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -384,7 +378,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort4a$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort4a$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -393,7 +387,7 @@ _llgo_0: ret i32 %5 } -define void @main.sort4b() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort4b"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @14) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -408,7 +402,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort4b$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort4b$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -432,7 +426,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort4b$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort4b$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -441,7 +435,7 @@ _llgo_0: ret i32 %5 } -define void @main.sort5a() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort5a"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @16) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -456,7 +450,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort5a$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort5a$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -480,7 +474,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort5a$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort5a$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -489,7 +483,7 @@ _llgo_0: ret i32 %5 } -define void @main.sort5b() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort5b"() { _llgo_0: %0 = call i32 (ptr, ...) @printf(ptr @18) %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 40) @@ -504,7 +498,7 @@ _llgo_0: store i64 2, ptr %5, align 4 store i64 7, ptr %6, align 4 %7 = getelementptr inbounds i64, ptr %1, i64 0 - call void @qsort(ptr %7, i64 5, i64 8, ptr @"main.sort5b$1") + call void @qsort(ptr %7, i64 5, i64 8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort5b$1") %8 = load [5 x i64], ptr %1, align 4 br label %_llgo_1 @@ -528,7 +522,7 @@ _llgo_3: ; preds = %_llgo_1 ret void } -define i32 @"main.sort5b$1"(ptr %0, ptr %1) { +define i32 @"github.com/goplus/llgo/compiler/cl/_testrt/qsortfn.sort5b$1"(ptr %0, ptr %1) { _llgo_0: %2 = load i64, ptr %0, align 4 %3 = load i64, ptr %1, align 4 @@ -537,8 +531,6 @@ _llgo_0: ret i32 %5 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @printf(ptr, ...) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) diff --git a/compiler/cl/_testrt/result/out.ll b/compiler/cl/_testrt/result/out.ll index a8a5e1cf..73f1f85b 100644 --- a/compiler/cl/_testrt/result/out.ll +++ b/compiler/cl/_testrt/result/out.ll @@ -1,104 +1,96 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/result' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/result" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/result.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 -define { ptr, ptr } @main.add() { +define { ptr, ptr } @"github.com/goplus/llgo/compiler/cl/_testrt/result.add"() { _llgo_0: - ret { ptr, ptr } { ptr @"__llgo_stub.main.add$1", ptr null } + ret { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/result.add$1", ptr null } } -define i64 @"main.add$1"(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/result.add$1"(i64 %0, i64 %1) { _llgo_0: %2 = add i64 %0, %1 ret i64 %2 } -define { { ptr, ptr }, i64 } @main.add2() { +define { { ptr, ptr }, i64 } @"github.com/goplus/llgo/compiler/cl/_testrt/result.add2"() { _llgo_0: - ret { { ptr, ptr }, i64 } { { ptr, ptr } { ptr @"__llgo_stub.main.add2$1", ptr null }, i64 1 } + ret { { ptr, ptr }, i64 } { { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/result.add2$1", ptr null }, i64 1 } } -define i64 @"main.add2$1"(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/result.add2$1"(i64 %0, i64 %1) { _llgo_0: %2 = add i64 %0, %1 ret i64 %2 } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/result.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/result.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/result.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/result.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call { ptr, ptr } @"main.main$1"() - %3 = extractvalue { ptr, ptr } %2, 1 - %4 = extractvalue { ptr, ptr } %2, 0 - %5 = call i64 %4(ptr %3, i64 100, i64 200) - %6 = call i32 (ptr, ...) @printf(ptr @0, i64 %5) - %7 = call { ptr, ptr } @main.add() - %8 = extractvalue { ptr, ptr } %7, 1 - %9 = extractvalue { ptr, ptr } %7, 0 - %10 = call i64 %9(ptr %8, i64 100, i64 200) - %11 = call i32 (ptr, ...) @printf(ptr @1, i64 %10) - %12 = call { { ptr, ptr }, i64 } @main.add2() - %13 = extractvalue { { ptr, ptr }, i64 } %12, 0 - %14 = extractvalue { { ptr, ptr }, i64 } %12, 1 - %15 = call { ptr, ptr } @main.add() - %16 = extractvalue { ptr, ptr } %15, 1 - %17 = extractvalue { ptr, ptr } %15, 0 - %18 = call i64 %17(ptr %16, i64 100, i64 200) - %19 = call i32 (ptr, ...) @printf(ptr @2, i64 %18, i64 %14) - ret i32 0 + %0 = call { ptr, ptr } @"github.com/goplus/llgo/compiler/cl/_testrt/result.main$1"() + %1 = extractvalue { ptr, ptr } %0, 1 + %2 = extractvalue { ptr, ptr } %0, 0 + %3 = call i64 %2(ptr %1, i64 100, i64 200) + %4 = call i32 (ptr, ...) @printf(ptr @0, i64 %3) + %5 = call { ptr, ptr } @"github.com/goplus/llgo/compiler/cl/_testrt/result.add"() + %6 = extractvalue { ptr, ptr } %5, 1 + %7 = extractvalue { ptr, ptr } %5, 0 + %8 = call i64 %7(ptr %6, i64 100, i64 200) + %9 = call i32 (ptr, ...) @printf(ptr @1, i64 %8) + %10 = call { { ptr, ptr }, i64 } @"github.com/goplus/llgo/compiler/cl/_testrt/result.add2"() + %11 = extractvalue { { ptr, ptr }, i64 } %10, 0 + %12 = extractvalue { { ptr, ptr }, i64 } %10, 1 + %13 = call { ptr, ptr } @"github.com/goplus/llgo/compiler/cl/_testrt/result.add"() + %14 = extractvalue { ptr, ptr } %13, 1 + %15 = extractvalue { ptr, ptr } %13, 0 + %16 = call i64 %15(ptr %14, i64 100, i64 200) + %17 = call i32 (ptr, ...) @printf(ptr @2, i64 %16, i64 %12) + ret void } -define { ptr, ptr } @"main.main$1"() { +define { ptr, ptr } @"github.com/goplus/llgo/compiler/cl/_testrt/result.main$1"() { _llgo_0: - ret { ptr, ptr } { ptr @"__llgo_stub.main.main$1$1", ptr null } + ret { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/result.main$1$1", ptr null } } -define i64 @"main.main$1$1"(i64 %0, i64 %1) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/result.main$1$1"(i64 %0, i64 %1) { _llgo_0: %2 = add i64 %0, %1 ret i64 %2 } -define linkonce i64 @"__llgo_stub.main.add$1"(ptr %0, i64 %1, i64 %2) { +define linkonce i64 @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/result.add$1"(ptr %0, i64 %1, i64 %2) { _llgo_0: - %3 = tail call i64 @"main.add$1"(i64 %1, i64 %2) + %3 = tail call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/result.add$1"(i64 %1, i64 %2) ret i64 %3 } -define linkonce i64 @"__llgo_stub.main.add2$1"(ptr %0, i64 %1, i64 %2) { +define linkonce i64 @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/result.add2$1"(ptr %0, i64 %1, i64 %2) { _llgo_0: - %3 = tail call i64 @"main.add2$1"(i64 %1, i64 %2) + %3 = tail call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/result.add2$1"(i64 %1, i64 %2) ret i64 %3 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @printf(ptr, ...) -define linkonce i64 @"__llgo_stub.main.main$1$1"(ptr %0, i64 %1, i64 %2) { +define linkonce i64 @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/result.main$1$1"(ptr %0, i64 %1, i64 %2) { _llgo_0: - %3 = tail call i64 @"main.main$1$1"(i64 %1, i64 %2) + %3 = tail call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/result.main$1$1"(i64 %1, i64 %2) ret i64 %3 } diff --git a/compiler/cl/_testrt/slice2array/out.ll b/compiler/cl/_testrt/slice2array/out.ll index 404e9ce5..31855c8f 100644 --- a/compiler/cl/_testrt/slice2array/out.ll +++ b/compiler/cl/_testrt/slice2array/out.ll @@ -1,111 +1,103 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/slice2array' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/slice2array" %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/slice2array.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/slice2array.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/slice2array.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/slice2array.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/slice2array.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) - %3 = getelementptr inbounds i8, ptr %2, i64 0 - %4 = getelementptr inbounds i8, ptr %2, i64 1 - %5 = getelementptr inbounds i8, ptr %2, i64 2 - %6 = getelementptr inbounds i8, ptr %2, i64 3 - store i8 1, ptr %3, align 1 - store i8 2, ptr %4, align 1 - store i8 3, ptr %5, align 1 - store i8 4, ptr %6, align 1 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 4, 1 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 4, 2 - %10 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 1 - %11 = icmp slt i64 %10, 4 - br i1 %11, label %_llgo_1, label %_llgo_2 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 4) + %1 = getelementptr inbounds i8, ptr %0, i64 0 + %2 = getelementptr inbounds i8, ptr %0, i64 1 + %3 = getelementptr inbounds i8, ptr %0, i64 2 + %4 = getelementptr inbounds i8, ptr %0, i64 3 + store i8 1, ptr %1, align 1 + store i8 2, ptr %2, align 1 + store i8 3, ptr %3, align 1 + store i8 4, ptr %4, align 1 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %5, i64 4, 1 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, i64 4, 2 + %8 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 1 + %9 = icmp slt i64 %8, 4 + br i1 %9, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %12 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PanicSliceConvert"(i64 %12, i64 4) + %10 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PanicSliceConvert"(i64 %10, i64 4) br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 - %13 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, 0 - %14 = load [4 x i8], ptr %2, align 1 - %15 = load [4 x i8], ptr %13, align 1 - %16 = extractvalue [4 x i8] %14, 0 - %17 = extractvalue [4 x i8] %15, 0 - %18 = icmp eq i8 %16, %17 - %19 = and i1 true, %18 - %20 = extractvalue [4 x i8] %14, 1 - %21 = extractvalue [4 x i8] %15, 1 - %22 = icmp eq i8 %20, %21 - %23 = and i1 %19, %22 - %24 = extractvalue [4 x i8] %14, 2 - %25 = extractvalue [4 x i8] %15, 2 - %26 = icmp eq i8 %24, %25 - %27 = and i1 %23, %26 - %28 = extractvalue [4 x i8] %14, 3 - %29 = extractvalue [4 x i8] %15, 3 - %30 = icmp eq i8 %28, %29 - %31 = and i1 %27, %30 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %31) + %11 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, 0 + %12 = load [4 x i8], ptr %0, align 1 + %13 = load [4 x i8], ptr %11, align 1 + %14 = extractvalue [4 x i8] %12, 0 + %15 = extractvalue [4 x i8] %13, 0 + %16 = icmp eq i8 %14, %15 + %17 = and i1 true, %16 + %18 = extractvalue [4 x i8] %12, 1 + %19 = extractvalue [4 x i8] %13, 1 + %20 = icmp eq i8 %18, %19 + %21 = and i1 %17, %20 + %22 = extractvalue [4 x i8] %12, 2 + %23 = extractvalue [4 x i8] %13, 2 + %24 = icmp eq i8 %22, %23 + %25 = and i1 %21, %24 + %26 = extractvalue [4 x i8] %12, 3 + %27 = extractvalue [4 x i8] %13, 3 + %28 = icmp eq i8 %26, %27 + %29 = and i1 %25, %28 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %29) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0 - %33 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %32, i64 4, 1 - %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %33, i64 4, 2 - %35 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %34, 1 - %36 = icmp slt i64 %35, 2 - br i1 %36, label %_llgo_3, label %_llgo_4 + %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0 + %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30, i64 4, 1 + %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31, i64 4, 2 + %33 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %32, 1 + %34 = icmp slt i64 %33, 2 + br i1 %34, label %_llgo_3, label %_llgo_4 _llgo_3: ; preds = %_llgo_2 - %37 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %34, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PanicSliceConvert"(i64 %37, i64 2) + %35 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %32, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PanicSliceConvert"(i64 %35, i64 2) br label %_llgo_4 _llgo_4: ; preds = %_llgo_3, %_llgo_2 - %38 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %34, 0 - %39 = load [2 x i8], ptr %38, align 1 - %40 = alloca [2 x i8], align 1 - call void @llvm.memset(ptr %40, i8 0, i64 2, i1 false) - %41 = getelementptr inbounds i8, ptr %40, i64 0 - %42 = getelementptr inbounds i8, ptr %40, i64 1 - store i8 1, ptr %41, align 1 - store i8 2, ptr %42, align 1 - %43 = load [2 x i8], ptr %40, align 1 - %44 = extractvalue [2 x i8] %39, 0 - %45 = extractvalue [2 x i8] %43, 0 - %46 = icmp eq i8 %44, %45 - %47 = and i1 true, %46 - %48 = extractvalue [2 x i8] %39, 1 - %49 = extractvalue [2 x i8] %43, 1 - %50 = icmp eq i8 %48, %49 - %51 = and i1 %47, %50 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %51) + %36 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %32, 0 + %37 = load [2 x i8], ptr %36, align 1 + %38 = alloca [2 x i8], align 1 + call void @llvm.memset(ptr %38, i8 0, i64 2, i1 false) + %39 = getelementptr inbounds i8, ptr %38, i64 0 + %40 = getelementptr inbounds i8, ptr %38, i64 1 + store i8 1, ptr %39, align 1 + store i8 2, ptr %40, align 1 + %41 = load [2 x i8], ptr %38, align 1 + %42 = extractvalue [2 x i8] %37, 0 + %43 = extractvalue [2 x i8] %41, 0 + %44 = icmp eq i8 %42, %43 + %45 = and i1 true, %44 + %46 = extractvalue [2 x i8] %37, 1 + %47 = extractvalue [2 x i8] %41, 1 + %48 = icmp eq i8 %46, %47 + %49 = and i1 %45, %48 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %49) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PanicSliceConvert"(i64, i64) diff --git a/compiler/cl/_testrt/slicelen/out.ll b/compiler/cl/_testrt/slicelen/out.ll index 76d8edf6..22476c07 100644 --- a/compiler/cl/_testrt/slicelen/out.ll +++ b/compiler/cl/_testrt/slicelen/out.ll @@ -1,32 +1,26 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/slicelen' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/slicelen" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/slicelen.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [7 x i8] c"len > 0", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/slicelen.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/slicelen.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/slicelen.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/slicelen.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) br i1 false, label %_llgo_1, label %_llgo_2 @@ -37,11 +31,9 @@ _llgo_1: ; preds = %_llgo_0 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) diff --git a/compiler/cl/_testrt/strlen/out.ll b/compiler/cl/_testrt/strlen/out.ll index fd0f7543..f8cf076a 100644 --- a/compiler/cl/_testrt/strlen/out.ll +++ b/compiler/cl/_testrt/strlen/out.ll @@ -1,62 +1,54 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/strlen' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/strlen" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } @"github.com/goplus/llgo/runtime/internal/runtime.cgoAlwaysFalse" = external global i1, align 1 -@main.format = global [10 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format" = global [10 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/strlen.init$guard" = global i1 false, align 1 -define ptr @main._Cgo_ptr(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen._Cgo_ptr"(ptr %0) { _llgo_0: ret ptr %0 } declare void @runtime.cgoUse(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -declare void @main._cgoCheckResult(%"github.com/goplus/llgo/runtime/internal/runtime.eface") +declare void @"github.com/goplus/llgo/compiler/cl/_testrt/strlen._cgoCheckResult"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.init$guard", align 1 call void @syscall.init() - store i8 72, ptr @main.format, align 1 - store i8 101, ptr getelementptr inbounds (i8, ptr @main.format, i64 1), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 2), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 3), align 1 - store i8 111, ptr getelementptr inbounds (i8, ptr @main.format, i64 4), align 1 - store i8 32, ptr getelementptr inbounds (i8, ptr @main.format, i64 5), align 1 - store i8 37, ptr getelementptr inbounds (i8, ptr @main.format, i64 6), align 1 - store i8 100, ptr getelementptr inbounds (i8, ptr @main.format, i64 7), align 1 - store i8 10, ptr getelementptr inbounds (i8, ptr @main.format, i64 8), align 1 - store i8 0, ptr getelementptr inbounds (i8, ptr @main.format, i64 9), align 1 + store i8 72, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", align 1 + store i8 101, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i64 1), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i64 2), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i64 3), align 1 + store i8 111, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i64 4), align 1 + store i8 32, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i64 5), align 1 + store i8 37, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i64 6), align 1 + store i8 100, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i64 7), align 1 + store i8 10, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i64 8), align 1 + store i8 0, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i64 9), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call i32 @strlen(ptr @main.format) - call void (ptr, ...) @printf(ptr @main.format, i32 %2) - ret i32 0 + %0 = call i32 @strlen(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format") + call void (ptr, ...) @printf(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/strlen.format", i32 %0) + ret void } declare void @syscall.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @strlen(ptr) declare void @printf(ptr, ...) diff --git a/compiler/cl/_testrt/struct/out.ll b/compiler/cl/_testrt/struct/out.ll index c041a601..3d595d07 100644 --- a/compiler/cl/_testrt/struct/out.ll +++ b/compiler/cl/_testrt/struct/out.ll @@ -1,89 +1,83 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/struct' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/struct" -%main.Foo = type { i32, i1 } +%"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo" = type { i32, i1 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } @"github.com/goplus/llgo/runtime/internal/runtime.cgoAlwaysFalse" = external global i1, align 1 -@main.format = global [10 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/struct.format" = global [10 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/struct.init$guard" = global i1 false, align 1 -define void @main.Foo.Print(%main.Foo %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo.Print"(%"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo" %0) { _llgo_0: - %1 = alloca %main.Foo, align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo", align 8 call void @llvm.memset(ptr %1, i8 0, i64 8, i1 false) - store %main.Foo %0, ptr %1, align 4 - %2 = getelementptr inbounds %main.Foo, ptr %1, i32 0, i32 1 + store %"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo" %0, ptr %1, align 4 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo", ptr %1, i32 0, i32 1 %3 = load i1, ptr %2, align 1 br i1 %3, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %4 = getelementptr inbounds %main.Foo, ptr %1, i32 0, i32 0 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo", ptr %1, i32 0, i32 0 %5 = load i32, ptr %4, align 4 - call void (ptr, ...) @printf(ptr @main.format, i32 %5) + call void (ptr, ...) @printf(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i32 %5) br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define void @"main.(*Foo).Print"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/struct.(*Foo).Print"(ptr %0) { _llgo_0: - %1 = load %main.Foo, ptr %0, align 4 - call void @main.Foo.Print(%main.Foo %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo", ptr %0, align 4 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo.Print"(%"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo" %1) ret void } -define ptr @main._Cgo_ptr(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct._Cgo_ptr"(ptr %0) { _llgo_0: ret ptr %0 } declare void @runtime.cgoUse(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -declare void @main._cgoCheckResult(%"github.com/goplus/llgo/runtime/internal/runtime.eface") +declare void @"github.com/goplus/llgo/compiler/cl/_testrt/struct._cgoCheckResult"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/struct.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.init$guard", align 1 call void @syscall.init() - store i8 72, ptr @main.format, align 1 - store i8 101, ptr getelementptr inbounds (i8, ptr @main.format, i64 1), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 2), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 3), align 1 - store i8 111, ptr getelementptr inbounds (i8, ptr @main.format, i64 4), align 1 - store i8 32, ptr getelementptr inbounds (i8, ptr @main.format, i64 5), align 1 - store i8 37, ptr getelementptr inbounds (i8, ptr @main.format, i64 6), align 1 - store i8 100, ptr getelementptr inbounds (i8, ptr @main.format, i64 7), align 1 - store i8 10, ptr getelementptr inbounds (i8, ptr @main.format, i64 8), align 1 - store i8 0, ptr getelementptr inbounds (i8, ptr @main.format, i64 9), align 1 + store i8 72, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", align 1 + store i8 101, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i64 1), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i64 2), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i64 3), align 1 + store i8 111, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i64 4), align 1 + store i8 32, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i64 5), align 1 + store i8 37, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i64 6), align 1 + store i8 100, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i64 7), align 1 + store i8 10, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i64 8), align 1 + store i8 0, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/struct.format", i64 9), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/struct.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = alloca %main.Foo, align 8 - call void @llvm.memset(ptr %2, i8 0, i64 8, i1 false) - %3 = getelementptr inbounds %main.Foo, ptr %2, i32 0, i32 0 - %4 = getelementptr inbounds %main.Foo, ptr %2, i32 0, i32 1 - store i32 100, ptr %3, align 4 - store i1 true, ptr %4, align 1 - %5 = load %main.Foo, ptr %2, align 4 - call void @main.Foo.Print(%main.Foo %5) - ret i32 0 + %0 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo", align 8 + call void @llvm.memset(ptr %0, i8 0, i64 8, i1 false) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo", ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo", ptr %0, i32 0, i32 1 + store i32 100, ptr %1, align 4 + store i1 true, ptr %2, align 1 + %3 = load %"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo", ptr %0, align 4 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo.Print"(%"github.com/goplus/llgo/compiler/cl/_testrt/struct.Foo" %3) + ret void } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) @@ -93,6 +87,4 @@ declare void @printf(ptr, ...) declare void @syscall.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/compiler/cl/_testrt/structsize/out.ll b/compiler/cl/_testrt/structsize/out.ll index 644f3dfc..3cd36e93 100644 --- a/compiler/cl/_testrt/structsize/out.ll +++ b/compiler/cl/_testrt/structsize/out.ll @@ -1,34 +1,26 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/structsize' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/structsize" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/structsize.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/structsize.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/structsize.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/structsize.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/structsize.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call i32 (ptr, ...) @printf(ptr @0, i64 14) - ret i32 0 + %0 = call i32 (ptr, ...) @printf(ptr @0, i64 14) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testrt/sum/out.ll b/compiler/cl/_testrt/sum/out.ll index 376c34cf..554609cc 100644 --- a/compiler/cl/_testrt/sum/out.ll +++ b/compiler/cl/_testrt/sum/out.ll @@ -1,50 +1,44 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/sum' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/sum" %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/sum.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [10 x i8] c"Hello %d\0A\00", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/sum.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/sum.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/sum.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/sum.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %3 = getelementptr inbounds i64, ptr %2, i64 0 - store i64 1, ptr %3, align 4 - %4 = getelementptr inbounds i64, ptr %2, i64 1 - store i64 2, ptr %4, align 4 - %5 = getelementptr inbounds i64, ptr %2, i64 2 - store i64 3, ptr %5, align 4 - %6 = getelementptr inbounds i64, ptr %2, i64 3 - store i64 4, ptr %6, align 4 - %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 4, 1 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 4, 2 - %10 = call i64 @main.sum(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9) - %11 = call i32 (ptr, ...) @printf(ptr @0, i64 %10) - ret i32 0 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %1 = getelementptr inbounds i64, ptr %0, i64 0 + store i64 1, ptr %1, align 4 + %2 = getelementptr inbounds i64, ptr %0, i64 1 + store i64 2, ptr %2, align 4 + %3 = getelementptr inbounds i64, ptr %0, i64 2 + store i64 3, ptr %3, align 4 + %4 = getelementptr inbounds i64, ptr %0, i64 3 + store i64 4, ptr %4, align 4 + %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %5, i64 4, 1 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, i64 4, 2 + %8 = call i64 @"github.com/goplus/llgo/compiler/cl/_testrt/sum.sum"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7) + %9 = call i32 (ptr, ...) @printf(ptr @0, i64 %8) + ret void } -define i64 @main.sum(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { +define i64 @"github.com/goplus/llgo/compiler/cl/_testrt/sum.sum"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0) { _llgo_0: %1 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %0, 1 br label %_llgo_1 @@ -72,8 +66,6 @@ _llgo_3: ; preds = %_llgo_1 ret i64 %2 } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testrt/tpabi/out.ll b/compiler/cl/_testrt/tpabi/out.ll index 8c44bc57..a5bf9a9a 100644 --- a/compiler/cl/_testrt/tpabi/out.ll +++ b/compiler/cl/_testrt/tpabi/out.ll @@ -1,7 +1,7 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/tpabi' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/tpabi" -%"main.T[string,int]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", i64 } +%"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", i64 } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } @@ -10,16 +10,14 @@ source_filename = "main" %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } %"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [1 x i8] c"a", align 1 -@"_llgo_main.T[string,int]" = linkonce global ptr null, align 8 -@1 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]" = linkonce global ptr null, align 8 +@1 = private unnamed_addr constant [48 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/tpabi", align 1 @2 = private unnamed_addr constant [13 x i8] c"T[string,int]", align 1 @_llgo_string = linkonce global ptr null, align 8 @_llgo_int = linkonce global ptr null, align 8 -@"main.struct$A2OTYqQyUOqOQ-i_F5iXeAKWtxeWGEuyeN7HCfULCDk" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.struct$A2OTYqQyUOqOQ-i_F5iXeAKWtxeWGEuyeN7HCfULCDk" = linkonce global ptr null, align 8 @3 = private unnamed_addr constant [1 x i8] c"m", align 1 @4 = private unnamed_addr constant [1 x i8] c"n", align 1 @5 = private unnamed_addr constant [4 x i8] c"Demo", align 1 @@ -27,107 +25,103 @@ source_filename = "main" @6 = private unnamed_addr constant [4 x i8] c"Info", align 1 @7 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 @8 = private unnamed_addr constant [5 x i8] c"hello", align 1 -@"*_llgo_main.T[string,int]" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]" = linkonce global ptr null, align 8 @"_llgo_iface$BP0p_lUsEd-IbbtJVukGmgrdQkqzcoYzSiwgUvgFvUs" = linkonce global ptr null, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = alloca %"main.T[string,int]", align 8 - call void @llvm.memset(ptr %2, i8 0, i64 24, i1 false) - %3 = getelementptr inbounds %"main.T[string,int]", ptr %2, i32 0, i32 0 - %4 = getelementptr inbounds %"main.T[string,int]", ptr %2, i32 0, i32 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 1 }, ptr %3, align 8 - store i64 1, ptr %4, align 4 - %5 = load %"main.T[string,int]", ptr %2, align 8 - %6 = load ptr, ptr @"_llgo_main.T[string,int]", align 8 - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) - store %"main.T[string,int]" %5, ptr %7, align 8 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %6, 0 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, ptr %7, 1 - %10 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, 0 - %11 = load ptr, ptr @"_llgo_main.T[string,int]", align 8 - %12 = icmp eq ptr %10, %11 - br i1 %12, label %_llgo_1, label %_llgo_2 + %0 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", align 8 + call void @llvm.memset(ptr %0, i8 0, i64 24, i1 false) + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %0, i32 0, i32 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 1 }, ptr %1, align 8 + store i64 1, ptr %2, align 4 + %3 = load %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %0, align 8 + %4 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", align 8 + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 24) + store %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]" %3, ptr %5, align 8 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr %5, 1 + %8 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, 0 + %9 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", align 8 + %10 = icmp eq ptr %8, %9 + br i1 %10, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %13 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9, 1 - %14 = load %"main.T[string,int]", ptr %13, align 8 - %15 = extractvalue %"main.T[string,int]" %14, 0 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %15) + %11 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, 1 + %12 = load %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %11, align 8 + %13 = extractvalue %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]" %12, 0 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %13) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %16 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) - %17 = getelementptr inbounds %"main.T[string,int]", ptr %16, i32 0, i32 0 - %18 = getelementptr inbounds %"main.T[string,int]", ptr %16, i32 0, i32 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 5 }, ptr %17, align 8 - store i64 100, ptr %18, align 4 - %19 = load ptr, ptr @"*_llgo_main.T[string,int]", align 8 - %20 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 - %21 = load ptr, ptr @"_llgo_iface$BP0p_lUsEd-IbbtJVukGmgrdQkqzcoYzSiwgUvgFvUs", align 8 - %22 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %21, ptr %19) - %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %22, 0 - %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %23, ptr %16, 1 - %25 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %24) - %26 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %24, 0 - %27 = getelementptr ptr, ptr %26, i64 3 - %28 = load ptr, ptr %27, align 8 - %29 = insertvalue { ptr, ptr } undef, ptr %28, 0 - %30 = insertvalue { ptr, ptr } %29, ptr %25, 1 - %31 = extractvalue { ptr, ptr } %30, 1 - %32 = extractvalue { ptr, ptr } %30, 0 - call void %32(ptr %31) - %33 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) - %34 = getelementptr inbounds i64, ptr %33, i64 0 - %35 = getelementptr inbounds i64, ptr %33, i64 1 - %36 = getelementptr inbounds i64, ptr %33, i64 2 - %37 = getelementptr inbounds i64, ptr %33, i64 3 - store i64 1, ptr %34, align 4 - store i64 2, ptr %35, align 4 - store i64 3, ptr %36, align 4 - store i64 4, ptr %37, align 4 - %38 = getelementptr [4 x i64], ptr %33, i64 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %38) + %14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24) + %15 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %14, i32 0, i32 0 + %16 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %14, i32 0, i32 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 5 }, ptr %15, align 8 + store i64 100, ptr %16, align 4 + %17 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", align 8 + %18 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 + %19 = load ptr, ptr @"_llgo_iface$BP0p_lUsEd-IbbtJVukGmgrdQkqzcoYzSiwgUvgFvUs", align 8 + %20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %19, ptr %17) + %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %20, 0 + %22 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %21, ptr %14, 1 + %23 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %22) + %24 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %22, 0 + %25 = getelementptr ptr, ptr %24, i64 3 + %26 = load ptr, ptr %25, align 8 + %27 = insertvalue { ptr, ptr } undef, ptr %26, 0 + %28 = insertvalue { ptr, ptr } %27, ptr %23, 1 + %29 = extractvalue { ptr, ptr } %28, 1 + %30 = extractvalue { ptr, ptr } %28, 0 + call void %30(ptr %29) + %31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 32) + %32 = getelementptr inbounds i64, ptr %31, i64 0 + %33 = getelementptr inbounds i64, ptr %31, i64 1 + %34 = getelementptr inbounds i64, ptr %31, i64 2 + %35 = getelementptr inbounds i64, ptr %31, i64 3 + store i64 1, ptr %32, align 4 + store i64 2, ptr %33, align 4 + store i64 3, ptr %34, align 4 + store i64 4, ptr %35, align 4 + %36 = getelementptr [4 x i64], ptr %31, i64 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %36) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %39 = getelementptr [4 x i64], ptr %33, i64 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %39) + %37 = getelementptr [4 x i64], ptr %31, i64 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr %37) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void _llgo_2: ; preds = %_llgo_0 - %40 = load ptr, ptr @_llgo_string, align 8 - %41 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %41, align 8 - %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %40, 0 - %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %42, ptr %41, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %43) + %38 = load ptr, ptr @_llgo_string, align 8 + %39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 21 }, ptr %39, align 8 + %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %38, 0 + %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %40, ptr %39, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %41) unreachable } -define linkonce void @"main.T[string,int].Info"(%"main.T[string,int]" %0) { +define linkonce void @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int].Info"(%"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]" %0) { _llgo_0: - %1 = alloca %"main.T[string,int]", align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", align 8 call void @llvm.memset(ptr %1, i8 0, i64 24, i1 false) - store %"main.T[string,int]" %0, ptr %1, align 8 - %2 = getelementptr inbounds %"main.T[string,int]", ptr %1, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]" %0, ptr %1, align 8 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %1, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, align 8 - %4 = getelementptr inbounds %"main.T[string,int]", ptr %1, i32 0, i32 1 + %4 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %1, i32 0, i32 1 %5 = load i64, ptr %4, align 4 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %3) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -136,11 +130,11 @@ _llgo_0: ret void } -define linkonce void @"main.(*T[string,int]).Demo"(ptr %0) { +define linkonce void @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.(*T[string,int]).Demo"(ptr %0) { _llgo_0: - %1 = getelementptr inbounds %"main.T[string,int]", ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %0, i32 0, i32 0 %2 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %1, align 8 - %3 = getelementptr inbounds %"main.T[string,int]", ptr %0, i32 0, i32 1 + %3 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %0, i32 0, i32 1 %4 = load i64, ptr %3, align 4 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %2) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) @@ -149,27 +143,25 @@ _llgo_0: ret void } -define void @"main.(*T[string,int]).Info"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.(*T[string,int]).Info"(ptr %0) { _llgo_0: - %1 = load %"main.T[string,int]", ptr %0, align 8 - call void @"main.T[string,int].Info"(%"main.T[string,int]" %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", ptr %0, align 8 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int].Info"(%"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]" %1) ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 13 }, i64 25, i64 24, i64 1, i64 2) - %1 = load ptr, ptr @"_llgo_main.T[string,int]", align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 13 }, i64 25, i64 24, i64 1, i64 2) + %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %0, ptr @"_llgo_main.T[string,int]", align 8 + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 @@ -207,9 +199,9 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %15, 0 %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18, i64 2, 1 %20 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19, i64 2, 2 - %21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %20) - store ptr %21, ptr @"main.struct$A2OTYqQyUOqOQ-i_F5iXeAKWtxeWGEuyeN7HCfULCDk", align 8 - %22 = load ptr, ptr @"main.struct$A2OTYqQyUOqOQ-i_F5iXeAKWtxeWGEuyeN7HCfULCDk", align 8 + %21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 48 }, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %20) + store ptr %21, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.struct$A2OTYqQyUOqOQ-i_F5iXeAKWtxeWGEuyeN7HCfULCDk", align 8 + %22 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.struct$A2OTYqQyUOqOQ-i_F5iXeAKWtxeWGEuyeN7HCfULCDk", align 8 br i1 %2, label %_llgo_7, label %_llgo_8 _llgo_7: ; preds = %_llgo_6 @@ -218,8 +210,8 @@ _llgo_7: ; preds = %_llgo_6 br i1 %24, label %_llgo_9, label %_llgo_10 _llgo_8: ; preds = %_llgo_10, %_llgo_6 - %25 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 13 }, i64 25, i64 24, i64 1, i64 2) - %26 = load ptr, ptr @"*_llgo_main.T[string,int]", align 8 + %25 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 13 }, i64 25, i64 24, i64 1, i64 2) + %26 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", align 8 %27 = icmp eq ptr %26, null br i1 %27, label %_llgo_11, label %_llgo_12 @@ -240,15 +232,15 @@ _llgo_9: ; preds = %_llgo_7 _llgo_10: ; preds = %_llgo_9, %_llgo_7 %37 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %38 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %37, 1 - %39 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %38, ptr @"main.(*T[string,int]).Demo", 2 - %40 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %39, ptr @"main.(*T[string,int]).Demo", 3 + %39 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %38, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.(*T[string,int]).Demo", 2 + %40 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %39, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.(*T[string,int]).Demo", 3 %41 = load ptr, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 %42 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %41, 1 - %43 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %42, ptr @"main.(*T[string,int]).Info", 2 - %44 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %43, ptr @"main.(*T[string,int]).Info", 3 + %43 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %42, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.(*T[string,int]).Info", 2 + %44 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %43, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.(*T[string,int]).Info", 3 %45 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %41, 1 - %46 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %45, ptr @"main.(*T[string,int]).Info", 2 - %47 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %46, ptr @"main.T[string,int].Info", 3 + %46 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %45, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.(*T[string,int]).Info", 2 + %47 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %46, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int].Info", 3 %48 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %49 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %48, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %47, ptr %49, align 8 @@ -269,7 +261,7 @@ _llgo_10: ; preds = %_llgo_9, %_llgo_7 _llgo_11: ; preds = %_llgo_8 %59 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %25) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %59) - store ptr %59, ptr @"*_llgo_main.T[string,int]", align 8 + store ptr %59, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpabi.T[string,int]", align 8 br label %_llgo_12 _llgo_12: ; preds = %_llgo_11, %_llgo_8 @@ -286,7 +278,7 @@ _llgo_13: ; preds = %_llgo_12 %66 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %64, 0 %67 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %66, i64 1, 1 %68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %67, i64 1, 2 - %69 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68) + %69 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68) store ptr %69, ptr @"_llgo_iface$BP0p_lUsEd-IbbtJVukGmgrdQkqzcoYzSiwgUvgFvUs", align 8 br label %_llgo_14 diff --git a/compiler/cl/_testrt/tpfunc/out.ll b/compiler/cl/_testrt/tpfunc/out.ll index d80843a9..7a86d8a0 100644 --- a/compiler/cl/_testrt/tpfunc/out.ll +++ b/compiler/cl/_testrt/tpfunc/out.ll @@ -1,39 +1,33 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/tpfunc' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/tpfunc" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.init$guard" = global i1 false, align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 16) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 8) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintUint"(i64 8) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -define void @"main.main$1"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.main$1"(ptr %0) { _llgo_0: %1 = load i64, ptr %0, align 4 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %1) @@ -41,7 +35,7 @@ _llgo_0: ret void } -define void @"main.main$2"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.main$2"(ptr %0) { _llgo_0: %1 = load i64, ptr %0, align 4 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %1) @@ -49,7 +43,7 @@ _llgo_0: ret void } -define void @"main.main$3"(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.main$3"(ptr %0) { _llgo_0: %1 = load i64, ptr %0, align 4 call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %1) @@ -57,11 +51,9 @@ _llgo_0: ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define linkonce void @"__llgo_stub.main.main$1"(ptr %0, ptr %1) { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.main$1"(ptr %0, ptr %1) { _llgo_0: - tail call void @"main.main$1"(ptr %1) + tail call void @"github.com/goplus/llgo/compiler/cl/_testrt/tpfunc.main$1"(ptr %1) ret void } diff --git a/compiler/cl/_testrt/tpmap/out.ll b/compiler/cl/_testrt/tpmap/out.ll index 0e1c42f0..137b165a 100644 --- a/compiler/cl/_testrt/tpmap/out.ll +++ b/compiler/cl/_testrt/tpmap/out.ll @@ -1,143 +1,135 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/tpmap' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/tpmap" -%main.cacheKey = type { i64, %main.T2, %"main.T3[any]", ptr, i64 } -%main.T2 = type { i64 } -%"main.T3[any]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.eface" } +%"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey" = type { i64, %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T2", %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T3[any]", ptr, i64 } +%"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T2" = type { i64 } +%"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T3[any]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.eface" } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 -@_llgo_main.cacheKey = linkonce global ptr null, align 8 -@0 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.init$guard" = global i1 false, align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey" = linkonce global ptr null, align 8 +@0 = private unnamed_addr constant [48 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/tpmap", align 1 @1 = private unnamed_addr constant [8 x i8] c"cacheKey", align 1 -@_llgo_main.T1 = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T1" = linkonce global ptr null, align 8 @2 = private unnamed_addr constant [2 x i8] c"T1", align 1 @_llgo_int = linkonce global ptr null, align 8 -@_llgo_main.T2 = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T2" = linkonce global ptr null, align 8 @3 = private unnamed_addr constant [2 x i8] c"T2", align 1 -@"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = linkonce global ptr null, align 8 @4 = private unnamed_addr constant [1 x i8] c"v", align 1 -@"_llgo_main.T3[any]" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T3[any]" = linkonce global ptr null, align 8 @5 = private unnamed_addr constant [7 x i8] c"T3[any]", align 1 @_llgo_any = linkonce global ptr null, align 8 -@"main.struct$op7q0963ur0ih9ul6OteH-C75UVydPxwKOVpX1hUjzo" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.struct$op7q0963ur0ih9ul6OteH-C75UVydPxwKOVpX1hUjzo" = linkonce global ptr null, align 8 @"*_llgo_int" = linkonce global ptr null, align 8 @_llgo_uintptr = linkonce global ptr null, align 8 -@"main.struct$ZLgMjv1XBA1L4yXCpdouRvQF2okeuHQ-YWVTE34gq4I" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.struct$H1D8cXR8QUFS3qIktzfQn9cRVh-lNVxvR-59uCOVwMs" = linkonce global ptr null, align 8 @6 = private unnamed_addr constant [2 x i8] c"t1", align 1 @7 = private unnamed_addr constant [2 x i8] c"t2", align 1 @8 = private unnamed_addr constant [2 x i8] c"t3", align 1 @9 = private unnamed_addr constant [2 x i8] c"t4", align 1 @10 = private unnamed_addr constant [2 x i8] c"t5", align 1 @_llgo_string = linkonce global ptr null, align 8 -@"map[_llgo_main.cacheKey]_llgo_string" = linkonce global ptr null, align 8 +@"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey]_llgo_string" = linkonce global ptr null, align 8 @11 = private unnamed_addr constant [7 x i8] c"topbits", align 1 @12 = private unnamed_addr constant [4 x i8] c"keys", align 1 @13 = private unnamed_addr constant [5 x i8] c"elems", align 1 @14 = private unnamed_addr constant [8 x i8] c"overflow", align 1 @15 = private unnamed_addr constant [5 x i8] c"world", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @_llgo_main.cacheKey, align 8 - %3 = load ptr, ptr @_llgo_string, align 8 - %4 = load ptr, ptr @"map[_llgo_main.cacheKey]_llgo_string", align 8 - %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %4, i64 0) - %6 = alloca %main.cacheKey, align 8 - call void @llvm.memset(ptr %6, i8 0, i64 48, i1 false) - %7 = getelementptr inbounds %main.cacheKey, ptr %6, i32 0, i32 0 - %8 = getelementptr inbounds %main.cacheKey, ptr %6, i32 0, i32 1 - %9 = getelementptr inbounds %main.T2, ptr %8, i32 0, i32 0 - %10 = getelementptr inbounds %main.cacheKey, ptr %6, i32 0, i32 2 - %11 = getelementptr inbounds %"main.T3[any]", ptr %10, i32 0, i32 0 - %12 = getelementptr inbounds %main.cacheKey, ptr %6, i32 0, i32 3 - %13 = getelementptr inbounds %main.cacheKey, ptr %6, i32 0, i32 4 + %0 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", align 8 + %1 = load ptr, ptr @_llgo_string, align 8 + %2 = load ptr, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey]_llgo_string", align 8 + %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %2, i64 0) + %4 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", align 8 + call void @llvm.memset(ptr %4, i8 0, i64 48, i1 false) + %5 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %4, i32 0, i32 0 + %6 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %4, i32 0, i32 1 + %7 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T2", ptr %6, i32 0, i32 0 + %8 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %4, i32 0, i32 2 + %9 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T3[any]", ptr %8, i32 0, i32 0 + %10 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %4, i32 0, i32 3 + %11 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %4, i32 0, i32 4 + store i64 0, ptr %5, align 4 store i64 0, ptr %7, align 4 - store i64 0, ptr %9, align 4 - %14 = load ptr, ptr @_llgo_int, align 8 - %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %14, 0 - %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %15, ptr null, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %16, ptr %11, align 8 - store ptr null, ptr %12, align 8 - store i64 0, ptr %13, align 4 - %17 = load %main.cacheKey, ptr %6, align 8 - %18 = load ptr, ptr @"map[_llgo_main.cacheKey]_llgo_string", align 8 - %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) - store %main.cacheKey %17, ptr %19, align 8 - %20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %18, ptr %5, ptr %19) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 5 }, ptr %20, align 8 - %21 = alloca %main.cacheKey, align 8 - call void @llvm.memset(ptr %21, i8 0, i64 48, i1 false) - %22 = getelementptr inbounds %main.cacheKey, ptr %21, i32 0, i32 0 - %23 = getelementptr inbounds %main.cacheKey, ptr %21, i32 0, i32 1 - %24 = getelementptr inbounds %main.T2, ptr %23, i32 0, i32 0 - %25 = getelementptr inbounds %main.cacheKey, ptr %21, i32 0, i32 2 - %26 = getelementptr inbounds %"main.T3[any]", ptr %25, i32 0, i32 0 - %27 = getelementptr inbounds %main.cacheKey, ptr %21, i32 0, i32 3 - %28 = getelementptr inbounds %main.cacheKey, ptr %21, i32 0, i32 4 + %12 = load ptr, ptr @_llgo_int, align 8 + %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %12, 0 + %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %13, ptr null, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %14, ptr %9, align 8 + store ptr null, ptr %10, align 8 + store i64 0, ptr %11, align 4 + %15 = load %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %4, align 8 + %16 = load ptr, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey]_llgo_string", align 8 + %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) + store %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey" %15, ptr %17, align 8 + %18 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %16, ptr %3, ptr %17) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @15, i64 5 }, ptr %18, align 8 + %19 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", align 8 + call void @llvm.memset(ptr %19, i8 0, i64 48, i1 false) + %20 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %19, i32 0, i32 0 + %21 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %19, i32 0, i32 1 + %22 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T2", ptr %21, i32 0, i32 0 + %23 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %19, i32 0, i32 2 + %24 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T3[any]", ptr %23, i32 0, i32 0 + %25 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %19, i32 0, i32 3 + %26 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %19, i32 0, i32 4 + store i64 0, ptr %20, align 4 store i64 0, ptr %22, align 4 - store i64 0, ptr %24, align 4 - %29 = load ptr, ptr @_llgo_int, align 8 - %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %29, 0 - %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %30, ptr null, 1 - store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %31, ptr %26, align 8 - store ptr null, ptr %27, align 8 - store i64 0, ptr %28, align 4 - %32 = load %main.cacheKey, ptr %21, align 8 - %33 = load ptr, ptr @"map[_llgo_main.cacheKey]_llgo_string", align 8 - %34 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) - store %main.cacheKey %32, ptr %34, align 8 - %35 = call { ptr, i1 } @"github.com/goplus/llgo/runtime/internal/runtime.MapAccess2"(ptr %33, ptr %5, ptr %34) - %36 = extractvalue { ptr, i1 } %35, 0 - %37 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %36, align 8 - %38 = extractvalue { ptr, i1 } %35, 1 - %39 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.String" %37, 0 - %40 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %39, i1 %38, 1 - %41 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %40, 0 - %42 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %40, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %41) + %27 = load ptr, ptr @_llgo_int, align 8 + %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %27, 0 + %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %28, ptr null, 1 + store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %29, ptr %24, align 8 + store ptr null, ptr %25, align 8 + store i64 0, ptr %26, align 4 + %30 = load %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", ptr %19, align 8 + %31 = load ptr, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey]_llgo_string", align 8 + %32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 48) + store %"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey" %30, ptr %32, align 8 + %33 = call { ptr, i1 } @"github.com/goplus/llgo/runtime/internal/runtime.MapAccess2"(ptr %31, ptr %3, ptr %32) + %34 = extractvalue { ptr, i1 } %33, 0 + %35 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %34, align 8 + %36 = extractvalue { ptr, i1 } %33, 1 + %37 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.String" %35, 0 + %38 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %37, i1 %36, 1 + %39 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %38, 0 + %40 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %38, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %39) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %42) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %40) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 8 }, i64 25, i64 48, i64 0, i64 0) - store ptr %0, ptr @_llgo_main.cacheKey, align 8 - %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 2 }, i64 2, i64 8, i64 0, i64 0) - %2 = load ptr, ptr @_llgo_main.T1, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 8 }, i64 25, i64 48, i64 0, i64 0) + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey", align 8 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 2 }, i64 2, i64 8, i64 0, i64 0) + %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T1", align 8 %3 = icmp eq ptr %2, null br i1 %3, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %1, ptr @_llgo_main.T1, align 8 + store ptr %1, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T1", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 @@ -159,14 +151,14 @@ _llgo_5: ; preds = %_llgo_4 br label %_llgo_6 _llgo_6: ; preds = %_llgo_5, %_llgo_4 - %8 = load ptr, ptr @_llgo_main.T1, align 8 - %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 2 }, i64 25, i64 8, i64 0, i64 0) - %10 = load ptr, ptr @_llgo_main.T2, align 8 + %8 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T1", align 8 + %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 2 }, i64 25, i64 8, i64 0, i64 0) + %10 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T2", align 8 %11 = icmp eq ptr %10, null br i1 %11, label %_llgo_7, label %_llgo_8 _llgo_7: ; preds = %_llgo_6 - store ptr %9, ptr @_llgo_main.T2, align 8 + store ptr %9, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T2", align 8 br label %_llgo_8 _llgo_8: ; preds = %_llgo_7, %_llgo_6 @@ -178,9 +170,9 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_6 %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %14, 0 %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16, i64 1, 1 %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, i64 1, 2 - %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18) - store ptr %19, ptr @"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 - %20 = load ptr, ptr @"main.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 + %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18) + store ptr %19, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 + %20 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8 br i1 %11, label %_llgo_9, label %_llgo_10 _llgo_9: ; preds = %_llgo_8 @@ -188,14 +180,14 @@ _llgo_9: ; preds = %_llgo_8 br label %_llgo_10 _llgo_10: ; preds = %_llgo_9, %_llgo_8 - %21 = load ptr, ptr @_llgo_main.T2, align 8 - %22 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 7 }, i64 25, i64 16, i64 0, i64 0) - %23 = load ptr, ptr @"_llgo_main.T3[any]", align 8 + %21 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T2", align 8 + %22 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 7 }, i64 25, i64 16, i64 0, i64 0) + %23 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T3[any]", align 8 %24 = icmp eq ptr %23, null br i1 %24, label %_llgo_11, label %_llgo_12 _llgo_11: ; preds = %_llgo_10 - store ptr %22, ptr @"_llgo_main.T3[any]", align 8 + store ptr %22, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T3[any]", align 8 br label %_llgo_12 _llgo_12: ; preds = %_llgo_11, %_llgo_10 @@ -208,7 +200,7 @@ _llgo_13: ; preds = %_llgo_12 %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %27, 0 %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28, i64 0, 1 %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29, i64 0, 2 - %31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30) + %31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30) store ptr %31, ptr @_llgo_any, align 8 br label %_llgo_14 @@ -218,7 +210,7 @@ _llgo_14: ; preds = %_llgo_13, %_llgo_12 %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %33, 0 %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %34, i64 0, 1 %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35, i64 0, 2 - %37 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36) + %37 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36) %38 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }, ptr %37, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56) %40 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %39, i64 0 @@ -226,9 +218,9 @@ _llgo_14: ; preds = %_llgo_13, %_llgo_12 %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %39, 0 %42 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %41, i64 1, 1 %43 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %42, i64 1, 2 - %44 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %43) - store ptr %44, ptr @"main.struct$op7q0963ur0ih9ul6OteH-C75UVydPxwKOVpX1hUjzo", align 8 - %45 = load ptr, ptr @"main.struct$op7q0963ur0ih9ul6OteH-C75UVydPxwKOVpX1hUjzo", align 8 + %44 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %43) + store ptr %44, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.struct$op7q0963ur0ih9ul6OteH-C75UVydPxwKOVpX1hUjzo", align 8 + %45 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.struct$op7q0963ur0ih9ul6OteH-C75UVydPxwKOVpX1hUjzo", align 8 br i1 %24, label %_llgo_15, label %_llgo_16 _llgo_15: ; preds = %_llgo_14 @@ -236,7 +228,7 @@ _llgo_15: ; preds = %_llgo_14 br label %_llgo_16 _llgo_16: ; preds = %_llgo_15, %_llgo_14 - %46 = load ptr, ptr @"_llgo_main.T3[any]", align 8 + %46 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.T3[any]", align 8 %47 = load ptr, ptr @"*_llgo_int", align 8 %48 = icmp eq ptr %47, null br i1 %48, label %_llgo_17, label %_llgo_18 @@ -261,9 +253,9 @@ _llgo_19: ; preds = %_llgo_18 _llgo_20: ; preds = %_llgo_19, %_llgo_18 %55 = load ptr, ptr @_llgo_uintptr, align 8 - %56 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 2 }, i64 2, i64 8, i64 0, i64 0) - %57 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 2 }, i64 25, i64 8, i64 0, i64 0) - %58 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 7 }, i64 25, i64 16, i64 0, i64 0) + %56 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 2 }, i64 2, i64 8, i64 0, i64 0) + %57 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 2 }, i64 25, i64 8, i64 0, i64 0) + %58 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 7 }, i64 25, i64 16, i64 0, i64 0) %59 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 2 }, ptr %56, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %60 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 2 }, ptr %57, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %61 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 2 }, ptr %58, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) @@ -286,9 +278,9 @@ _llgo_20: ; preds = %_llgo_19, %_llgo_18 %73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %67, 0 %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %73, i64 5, 1 %75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %74, i64 5, 2 - %76 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 48, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75) - store ptr %76, ptr @"main.struct$ZLgMjv1XBA1L4yXCpdouRvQF2okeuHQ-YWVTE34gq4I", align 8 - %77 = load ptr, ptr @"main.struct$ZLgMjv1XBA1L4yXCpdouRvQF2okeuHQ-YWVTE34gq4I", align 8 + %76 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, i64 48, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75) + store ptr %76, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.struct$H1D8cXR8QUFS3qIktzfQn9cRVh-lNVxvR-59uCOVwMs", align 8 + %77 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmap.struct$H1D8cXR8QUFS3qIktzfQn9cRVh-lNVxvR-59uCOVwMs", align 8 call void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr %0, ptr %77, { ptr, i64, i64 } zeroinitializer, { ptr, i64, i64 } zeroinitializer) %78 = load ptr, ptr @_llgo_string, align 8 %79 = icmp eq ptr %78, null @@ -300,8 +292,8 @@ _llgo_21: ; preds = %_llgo_20 br label %_llgo_22 _llgo_22: ; preds = %_llgo_21, %_llgo_20 - %81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 8 }, i64 25, i64 48, i64 0, i64 0) - %82 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 8 }, i64 25, i64 48, i64 0, i64 0) + %81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 8 }, i64 25, i64 48, i64 0, i64 0) + %82 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 8 }, i64 25, i64 48, i64 0, i64 0) %83 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 24) %84 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 40) %85 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %84) @@ -325,10 +317,10 @@ _llgo_22: ; preds = %_llgo_21, %_llgo_20 %99 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %94, 0 %100 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %99, i64 4, 1 %101 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %100, i64 4, 2 - %102 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 4 }, i64 528, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %101) + %102 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, i64 528, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %101) %103 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %81, ptr %83, ptr %102, i64 24) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %103) - store ptr %103, ptr @"map[_llgo_main.cacheKey]_llgo_string", align 8 + store ptr %103, ptr @"map[_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmap.cacheKey]_llgo_string", align 8 ret void } diff --git a/compiler/cl/_testrt/tpmethod/out.ll b/compiler/cl/_testrt/tpmethod/out.ll index ee434872..5d116edd 100644 --- a/compiler/cl/_testrt/tpmethod/out.ll +++ b/compiler/cl/_testrt/tpmethod/out.ll @@ -1,126 +1,120 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/tpmethod' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/tpmethod" %"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } -%"main.Tuple[error]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } -%"main.future[main.Tuple[error]]" = type { { ptr, ptr } } +%"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" = type { %"github.com/goplus/llgo/runtime/internal/runtime.iface" } +%"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]" = type { { ptr, ptr } } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } %"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr } %"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [7 x i8] c"foo.txt", align 1 -@"_llgo_main.future[main.Tuple[error]]" = linkonce global ptr null, align 8 -@1 = private unnamed_addr constant [4 x i8] c"main", align 1 -@2 = private unnamed_addr constant [25 x i8] c"future[main.Tuple[error]]", align 1 -@"_llgo_main.Tuple[error]" = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]" = linkonce global ptr null, align 8 +@1 = private unnamed_addr constant [51 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod", align 1 +@2 = private unnamed_addr constant [72 x i8] c"future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]", align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" = linkonce global ptr null, align 8 @3 = private unnamed_addr constant [12 x i8] c"Tuple[error]", align 1 @_llgo_error = linkonce global ptr null, align 8 @4 = private unnamed_addr constant [5 x i8] c"error", align 1 @_llgo_string = linkonce global ptr null, align 8 @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to" = linkonce global ptr null, align 8 @5 = private unnamed_addr constant [5 x i8] c"Error", align 1 -@"main.struct$ddtj0teo4LtYcagzh1w6BsSZ7226uefXlqreeHsfVRo" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$ddtj0teo4LtYcagzh1w6BsSZ7226uefXlqreeHsfVRo" = linkonce global ptr null, align 8 @6 = private unnamed_addr constant [1 x i8] c"v", align 1 @7 = private unnamed_addr constant [3 x i8] c"Get", align 1 @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w" = linkonce global ptr null, align 8 -@"_llgo_func$1BeCdGdxwWG-Dtl1HbNuSy2_sb8rBMTmu7zhcPPofmU" = linkonce global ptr null, align 8 +@"_llgo_func$JEZg2HNYvw8IAggzDgQI9QLqcvOvX0DMdttkifcZmV0" = linkonce global ptr null, align 8 @_llgo_Pointer = linkonce global ptr null, align 8 -@"main.struct$vwhCZhgsid50r1SsT8OmKpRI0Cpljg78h5JlpD1CTR4" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$mkld3EWqBOn-24FyZ5FtegwU8xiSpI84vxQJqk56Bi4" = linkonce global ptr null, align 8 @8 = private unnamed_addr constant [2 x i8] c"$f", align 1 @9 = private unnamed_addr constant [5 x i8] c"$data", align 1 -@"_llgo_func$_so3zZGPIhTQghxFcf7CCCVzSOk2lxOt7xgGKcTzc0s" = linkonce global ptr null, align 8 -@"main.struct$awGH2Wh33bS1v_s7SNAwKW27E20HcwiiPPzh9UA7QDs" = linkonce global ptr null, align 8 -@"main.struct$N1awC7qGapVTS_NFj1Q0jk6nCjATrIK-60oOEyDjabo" = linkonce global ptr null, align 8 +@"_llgo_func$7nUTt2YVMXCmrXEy9bAXGeGHQ2qjM-ltFZOTJ7kc2oc" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$h0x5MUrZjI2t93KW7G5Ookzv6qIV0lh7-bP4KCXTtD4" = linkonce global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$sZkgOwzwSVW5_7o2czBO4vd0Y6GnzBmlznPz4599nqg" = linkonce global ptr null, align 8 @10 = private unnamed_addr constant [2 x i8] c"fn", align 1 @11 = private unnamed_addr constant [4 x i8] c"Then", align 1 -@"*_llgo_main.future[main.Tuple[error]]" = linkonce global ptr null, align 8 -@"_llgo_iface$pTofAxYfPZHsCMD5T70nrOx1gjHf9m2QCLNvEOl1py0" = linkonce global ptr null, align 8 +@"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]" = linkonce global ptr null, align 8 +@"_llgo_iface$vZQIEKY9NTKV50wpjIW4TLdy5d2nWtc2Lxm3TTPFcc0" = linkonce global ptr null, align 8 -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.ReadFile(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.ReadFile"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) { _llgo_0: - %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.Async[main.Tuple[error]]"({ ptr, ptr } { ptr @"__llgo_stub.main.ReadFile$1", ptr null }) + %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Async[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]"({ ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.ReadFile$1", ptr null }) ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1 } -define void @"main.ReadFile$1"({ ptr, ptr } %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.ReadFile$1"({ ptr, ptr } %0) { _llgo_0: - %1 = alloca %"main.Tuple[error]", align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", align 8 call void @llvm.memset(ptr %1, i8 0, i64 16, i1 false) - %2 = getelementptr inbounds %"main.Tuple[error]", ptr %1, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", ptr %1, i32 0, i32 0 store %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer, ptr %2, align 8 - %3 = load %"main.Tuple[error]", ptr %1, align 8 + %3 = load %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", ptr %1, align 8 %4 = extractvalue { ptr, ptr } %0, 1 %5 = extractvalue { ptr, ptr } %0, 0 - call void %5(ptr %4, %"main.Tuple[error]" %3) + call void %5(ptr %4, %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" %3) ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @main.ReadFile(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 7 }) - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %2) - %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2, 0 - %5 = getelementptr ptr, ptr %4, i64 3 - %6 = load ptr, ptr %5, align 8 - %7 = insertvalue { ptr, ptr } undef, ptr %6, 0 - %8 = insertvalue { ptr, ptr } %7, ptr %3, 1 - %9 = extractvalue { ptr, ptr } %8, 1 - %10 = extractvalue { ptr, ptr } %8, 0 - call void %10(ptr %9, { ptr, ptr } { ptr @"__llgo_stub.main.main$1", ptr null }) - ret i32 0 + %0 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.ReadFile"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 7 }) + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) + %2 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, 0 + %3 = getelementptr ptr, ptr %2, i64 3 + %4 = load ptr, ptr %3, align 8 + %5 = insertvalue { ptr, ptr } undef, ptr %4, 0 + %6 = insertvalue { ptr, ptr } %5, ptr %1, 1 + %7 = extractvalue { ptr, ptr } %6, 1 + %8 = extractvalue { ptr, ptr } %6, 0 + call void %8(ptr %7, { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.main$1", ptr null }) + ret void } -define void @"main.main$1"(%"main.Tuple[error]" %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.main$1"(%"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" %0) { _llgo_0: - %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.Tuple[error].Get"(%"main.Tuple[error]" %0) + %1 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error].Get"(%"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" %0) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintIface"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) ret void } -define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.Tuple[error].Get"(%"main.Tuple[error]" %0) { +define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error].Get"(%"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" %0) { _llgo_0: - %1 = alloca %"main.Tuple[error]", align 8 + %1 = alloca %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", align 8 call void @llvm.memset(ptr %1, i8 0, i64 16, i1 false) - store %"main.Tuple[error]" %0, ptr %1, align 8 - %2 = getelementptr inbounds %"main.Tuple[error]", ptr %1, i32 0, i32 0 + store %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" %0, ptr %1, align 8 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", ptr %1, i32 0, i32 0 %3 = load %"github.com/goplus/llgo/runtime/internal/runtime.iface", ptr %2, align 8 ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %3 } -define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.(*Tuple[error]).Get"(ptr %0) { +define %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.(*Tuple[error]).Get"(ptr %0) { _llgo_0: - %1 = load %"main.Tuple[error]", ptr %0, align 8 - %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.Tuple[error].Get"(%"main.Tuple[error]" %1) + %1 = load %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", ptr %0, align 8 + %2 = call %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error].Get"(%"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" %1) ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %2 } -define linkonce void @"main.(*future[main.Tuple[error]]).Then"(ptr %0, { ptr, ptr } %1) { +define linkonce void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.(*future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]).Then"(ptr %0, { ptr, ptr } %1) { _llgo_0: - %2 = getelementptr inbounds %"main.future[main.Tuple[error]]", ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]", ptr %0, i32 0, i32 0 %3 = load { ptr, ptr }, ptr %2, align 8 %4 = extractvalue { ptr, ptr } %3, 1 %5 = extractvalue { ptr, ptr } %3, 0 @@ -128,39 +122,37 @@ _llgo_0: ret void } -define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"main.Async[main.Tuple[error]]"({ ptr, ptr } %0) { +define linkonce %"github.com/goplus/llgo/runtime/internal/runtime.iface" @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Async[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]"({ ptr, ptr } %0) { _llgo_0: %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %2 = getelementptr inbounds %"main.future[main.Tuple[error]]", ptr %1, i32 0, i32 0 + %2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]", ptr %1, i32 0, i32 0 store { ptr, ptr } %0, ptr %2, align 8 - %3 = load ptr, ptr @"_llgo_main.future[main.Tuple[error]]", align 8 - %4 = load ptr, ptr @"*_llgo_main.future[main.Tuple[error]]", align 8 - %5 = load ptr, ptr @"_llgo_func$1BeCdGdxwWG-Dtl1HbNuSy2_sb8rBMTmu7zhcPPofmU", align 8 - %6 = load ptr, ptr @"main.struct$vwhCZhgsid50r1SsT8OmKpRI0Cpljg78h5JlpD1CTR4", align 8 - %7 = load ptr, ptr @"_llgo_func$_so3zZGPIhTQghxFcf7CCCVzSOk2lxOt7xgGKcTzc0s", align 8 - %8 = load ptr, ptr @"_llgo_iface$pTofAxYfPZHsCMD5T70nrOx1gjHf9m2QCLNvEOl1py0", align 8 + %3 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]", align 8 + %4 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]", align 8 + %5 = load ptr, ptr @"_llgo_func$JEZg2HNYvw8IAggzDgQI9QLqcvOvX0DMdttkifcZmV0", align 8 + %6 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$mkld3EWqBOn-24FyZ5FtegwU8xiSpI84vxQJqk56Bi4", align 8 + %7 = load ptr, ptr @"_llgo_func$7nUTt2YVMXCmrXEy9bAXGeGHQ2qjM-ltFZOTJ7kc2oc", align 8 + %8 = load ptr, ptr @"_llgo_iface$vZQIEKY9NTKV50wpjIW4TLdy5d2nWtc2Lxm3TTPFcc0", align 8 %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %8, ptr %4) %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %9, 0 %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %10, ptr %1, 1 ret %"github.com/goplus/llgo/runtime/internal/runtime.iface" %11 } -define linkonce void @"__llgo_stub.main.ReadFile$1"(ptr %0, { ptr, ptr } %1) { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.ReadFile$1"(ptr %0, { ptr, ptr } %1) { _llgo_0: - tail call void @"main.ReadFile$1"({ ptr, ptr } %1) + tail call void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.ReadFile$1"({ ptr, ptr } %1) ret void } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface") -define linkonce void @"__llgo_stub.main.main$1"(ptr %0, %"main.Tuple[error]" %1) { +define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.main$1"(ptr %0, %"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" %1) { _llgo_0: - tail call void @"main.main$1"(%"main.Tuple[error]" %1) + tail call void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.main$1"(%"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]" %1) ret void } @@ -170,17 +162,17 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 25 }, i64 25, i64 24, i64 0, i64 1) - store ptr %0, ptr @"_llgo_main.future[main.Tuple[error]]", align 8 - %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 12 }, i64 25, i64 16, i64 1, i64 1) - %2 = load ptr, ptr @"_llgo_main.Tuple[error]", align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 51 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 72 }, i64 25, i64 24, i64 0, i64 1) + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]", align 8 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 51 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 12 }, i64 25, i64 16, i64 1, i64 1) + %2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", align 8 %3 = icmp eq ptr %2, null br i1 %3, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %1, ptr @"_llgo_main.Tuple[error]", align 8 + store ptr %1, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 @@ -251,9 +243,9 @@ _llgo_10: ; preds = %_llgo_9, %_llgo_8 %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %34, 0 %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36, i64 1, 1 %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %37, i64 1, 2 - %39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38) - store ptr %39, ptr @"main.struct$ddtj0teo4LtYcagzh1w6BsSZ7226uefXlqreeHsfVRo", align 8 - %40 = load ptr, ptr @"main.struct$ddtj0teo4LtYcagzh1w6BsSZ7226uefXlqreeHsfVRo", align 8 + %39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38) + store ptr %39, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$ddtj0teo4LtYcagzh1w6BsSZ7226uefXlqreeHsfVRo", align 8 + %40 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$ddtj0teo4LtYcagzh1w6BsSZ7226uefXlqreeHsfVRo", align 8 br i1 %3, label %_llgo_11, label %_llgo_12 _llgo_11: ; preds = %_llgo_10 @@ -263,9 +255,9 @@ _llgo_11: ; preds = %_llgo_10 br i1 %43, label %_llgo_13, label %_llgo_14 _llgo_12: ; preds = %_llgo_14, %_llgo_10 - %44 = load ptr, ptr @"_llgo_main.Tuple[error]", align 8 - %45 = load ptr, ptr @"_llgo_main.Tuple[error]", align 8 - %46 = load ptr, ptr @"_llgo_func$1BeCdGdxwWG-Dtl1HbNuSy2_sb8rBMTmu7zhcPPofmU", align 8 + %44 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", align 8 + %45 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", align 8 + %46 = load ptr, ptr @"_llgo_func$JEZg2HNYvw8IAggzDgQI9QLqcvOvX0DMdttkifcZmV0", align 8 %47 = icmp eq ptr %46, null br i1 %47, label %_llgo_15, label %_llgo_16 @@ -288,11 +280,11 @@ _llgo_13: ; preds = %_llgo_11 _llgo_14: ; preds = %_llgo_13, %_llgo_11 %58 = load ptr, ptr @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w", align 8 %59 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 3 }, ptr undef, ptr undef, ptr undef }, ptr %58, 1 - %60 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %59, ptr @"main.(*Tuple[error]).Get", 2 - %61 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %60, ptr @"main.(*Tuple[error]).Get", 3 + %60 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %59, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.(*Tuple[error]).Get", 2 + %61 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %60, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.(*Tuple[error]).Get", 3 %62 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 3 }, ptr undef, ptr undef, ptr undef }, ptr %58, 1 - %63 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %62, ptr @"main.(*Tuple[error]).Get", 2 - %64 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %63, ptr @"main.Tuple[error].Get", 3 + %63 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %62, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.(*Tuple[error]).Get", 2 + %64 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %63, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error].Get", 3 %65 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %66 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %65, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %64, ptr %66, align 8 @@ -321,11 +313,11 @@ _llgo_15: ; preds = %_llgo_12 %83 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %82, i64 0, 2 %84 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Func"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %79, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %83, i1 false) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %84) - store ptr %84, ptr @"_llgo_func$1BeCdGdxwWG-Dtl1HbNuSy2_sb8rBMTmu7zhcPPofmU", align 8 + store ptr %84, ptr @"_llgo_func$JEZg2HNYvw8IAggzDgQI9QLqcvOvX0DMdttkifcZmV0", align 8 br label %_llgo_16 _llgo_16: ; preds = %_llgo_15, %_llgo_12 - %85 = load ptr, ptr @"_llgo_func$1BeCdGdxwWG-Dtl1HbNuSy2_sb8rBMTmu7zhcPPofmU", align 8 + %85 = load ptr, ptr @"_llgo_func$JEZg2HNYvw8IAggzDgQI9QLqcvOvX0DMdttkifcZmV0", align 8 %86 = load ptr, ptr @_llgo_Pointer, align 8 %87 = icmp eq ptr %86, null br i1 %87, label %_llgo_17, label %_llgo_18 @@ -338,7 +330,7 @@ _llgo_17: ; preds = %_llgo_16 _llgo_18: ; preds = %_llgo_17, %_llgo_16 %89 = load ptr, ptr @_llgo_Pointer, align 8 - %90 = load ptr, ptr @"_llgo_main.Tuple[error]", align 8 + %90 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]", align 8 %91 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %92 = getelementptr ptr, ptr %91, i64 0 store ptr %90, ptr %92, align 8 @@ -361,11 +353,11 @@ _llgo_18: ; preds = %_llgo_17, %_llgo_16 %107 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %104, 0 %108 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %107, i64 2, 1 %109 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %108, i64 2, 2 - %110 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %109) - store ptr %110, ptr @"main.struct$vwhCZhgsid50r1SsT8OmKpRI0Cpljg78h5JlpD1CTR4", align 8 - %111 = load ptr, ptr @"main.struct$vwhCZhgsid50r1SsT8OmKpRI0Cpljg78h5JlpD1CTR4", align 8 - %112 = load ptr, ptr @"main.struct$vwhCZhgsid50r1SsT8OmKpRI0Cpljg78h5JlpD1CTR4", align 8 - %113 = load ptr, ptr @"_llgo_func$_so3zZGPIhTQghxFcf7CCCVzSOk2lxOt7xgGKcTzc0s", align 8 + %110 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %109) + store ptr %110, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$mkld3EWqBOn-24FyZ5FtegwU8xiSpI84vxQJqk56Bi4", align 8 + %111 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$mkld3EWqBOn-24FyZ5FtegwU8xiSpI84vxQJqk56Bi4", align 8 + %112 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$mkld3EWqBOn-24FyZ5FtegwU8xiSpI84vxQJqk56Bi4", align 8 + %113 = load ptr, ptr @"_llgo_func$7nUTt2YVMXCmrXEy9bAXGeGHQ2qjM-ltFZOTJ7kc2oc", align 8 %114 = icmp eq ptr %113, null br i1 %114, label %_llgo_19, label %_llgo_20 @@ -382,12 +374,12 @@ _llgo_19: ; preds = %_llgo_18 %123 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %122, i64 0, 2 %124 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Func"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %119, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %123, i1 false) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %124) - store ptr %124, ptr @"_llgo_func$_so3zZGPIhTQghxFcf7CCCVzSOk2lxOt7xgGKcTzc0s", align 8 + store ptr %124, ptr @"_llgo_func$7nUTt2YVMXCmrXEy9bAXGeGHQ2qjM-ltFZOTJ7kc2oc", align 8 br label %_llgo_20 _llgo_20: ; preds = %_llgo_19, %_llgo_18 - %125 = load ptr, ptr @"_llgo_func$_so3zZGPIhTQghxFcf7CCCVzSOk2lxOt7xgGKcTzc0s", align 8 - %126 = load ptr, ptr @"main.struct$vwhCZhgsid50r1SsT8OmKpRI0Cpljg78h5JlpD1CTR4", align 8 + %125 = load ptr, ptr @"_llgo_func$7nUTt2YVMXCmrXEy9bAXGeGHQ2qjM-ltFZOTJ7kc2oc", align 8 + %126 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$mkld3EWqBOn-24FyZ5FtegwU8xiSpI84vxQJqk56Bi4", align 8 %127 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %128 = getelementptr ptr, ptr %127, i64 0 store ptr %126, ptr %128, align 8 @@ -410,10 +402,10 @@ _llgo_20: ; preds = %_llgo_19, %_llgo_18 %143 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %140, 0 %144 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %143, i64 2, 1 %145 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %144, i64 2, 2 - %146 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %145) - store ptr %146, ptr @"main.struct$awGH2Wh33bS1v_s7SNAwKW27E20HcwiiPPzh9UA7QDs", align 8 - %147 = load ptr, ptr @"main.struct$awGH2Wh33bS1v_s7SNAwKW27E20HcwiiPPzh9UA7QDs", align 8 - %148 = load ptr, ptr @"main.struct$vwhCZhgsid50r1SsT8OmKpRI0Cpljg78h5JlpD1CTR4", align 8 + %146 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %145) + store ptr %146, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$h0x5MUrZjI2t93KW7G5Ookzv6qIV0lh7-bP4KCXTtD4", align 8 + %147 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$h0x5MUrZjI2t93KW7G5Ookzv6qIV0lh7-bP4KCXTtD4", align 8 + %148 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$mkld3EWqBOn-24FyZ5FtegwU8xiSpI84vxQJqk56Bi4", align 8 %149 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8) %150 = getelementptr ptr, ptr %149, i64 0 store ptr %148, ptr %150, align 8 @@ -436,7 +428,7 @@ _llgo_20: ; preds = %_llgo_19, %_llgo_18 %165 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %162, 0 %166 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %165, i64 2, 1 %167 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %166, i64 2, 2 - %168 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %167) + %168 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %167) %169 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @10, i64 2 }, ptr %168, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false) %170 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56) %171 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %170, i64 0 @@ -444,15 +436,15 @@ _llgo_20: ; preds = %_llgo_19, %_llgo_18 %172 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %170, 0 %173 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %172, i64 1, 1 %174 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %173, i64 1, 2 - %175 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %174) - store ptr %175, ptr @"main.struct$N1awC7qGapVTS_NFj1Q0jk6nCjATrIK-60oOEyDjabo", align 8 - %176 = load ptr, ptr @"main.struct$N1awC7qGapVTS_NFj1Q0jk6nCjATrIK-60oOEyDjabo", align 8 - %177 = load ptr, ptr @"_llgo_func$1BeCdGdxwWG-Dtl1HbNuSy2_sb8rBMTmu7zhcPPofmU", align 8 - %178 = load ptr, ptr @"main.struct$vwhCZhgsid50r1SsT8OmKpRI0Cpljg78h5JlpD1CTR4", align 8 - %179 = load ptr, ptr @"_llgo_func$_so3zZGPIhTQghxFcf7CCCVzSOk2lxOt7xgGKcTzc0s", align 8 + %175 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 51 }, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %174) + store ptr %175, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$sZkgOwzwSVW5_7o2czBO4vd0Y6GnzBmlznPz4599nqg", align 8 + %176 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$sZkgOwzwSVW5_7o2czBO4vd0Y6GnzBmlznPz4599nqg", align 8 + %177 = load ptr, ptr @"_llgo_func$JEZg2HNYvw8IAggzDgQI9QLqcvOvX0DMdttkifcZmV0", align 8 + %178 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.struct$mkld3EWqBOn-24FyZ5FtegwU8xiSpI84vxQJqk56Bi4", align 8 + %179 = load ptr, ptr @"_llgo_func$7nUTt2YVMXCmrXEy9bAXGeGHQ2qjM-ltFZOTJ7kc2oc", align 8 %180 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %179, 1 - %181 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %180, ptr @"main.(*future[main.Tuple[error]]).Then", 2 - %182 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %181, ptr @"main.(*future[main.Tuple[error]]).Then", 3 + %181 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %180, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.(*future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]).Then", 2 + %182 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %181, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.(*future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]).Then", 3 %183 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 40) %184 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %183, i64 0 store %"github.com/goplus/llgo/runtime/abi.Method" %182, ptr %184, align 8 @@ -460,12 +452,12 @@ _llgo_20: ; preds = %_llgo_19, %_llgo_18 %186 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %185, i64 1, 1 %187 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %186, i64 1, 2 call void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr %0, ptr %176, { ptr, i64, i64 } zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %187) - %188 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 25 }, i64 25, i64 24, i64 0, i64 1) + %188 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 51 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 72 }, i64 25, i64 24, i64 0, i64 1) %189 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %188) call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %189) - store ptr %189, ptr @"*_llgo_main.future[main.Tuple[error]]", align 8 - %190 = load ptr, ptr @"_llgo_func$_so3zZGPIhTQghxFcf7CCCVzSOk2lxOt7xgGKcTzc0s", align 8 - %191 = load ptr, ptr @"_llgo_iface$pTofAxYfPZHsCMD5T70nrOx1gjHf9m2QCLNvEOl1py0", align 8 + store ptr %189, ptr @"*_llgo_github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.future[github.com/goplus/llgo/compiler/cl/_testrt/tpmethod.Tuple[error]]", align 8 + %190 = load ptr, ptr @"_llgo_func$7nUTt2YVMXCmrXEy9bAXGeGHQ2qjM-ltFZOTJ7kc2oc", align 8 + %191 = load ptr, ptr @"_llgo_iface$vZQIEKY9NTKV50wpjIW4TLdy5d2nWtc2Lxm3TTPFcc0", align 8 %192 = icmp eq ptr %191, null br i1 %192, label %_llgo_21, label %_llgo_22 @@ -477,8 +469,8 @@ _llgo_21: ; preds = %_llgo_20 %196 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %194, 0 %197 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %196, i64 1, 1 %198 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %197, i64 1, 2 - %199 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %198) - store ptr %199, ptr @"_llgo_iface$pTofAxYfPZHsCMD5T70nrOx1gjHf9m2QCLNvEOl1py0", align 8 + %199 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 51 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %198) + store ptr %199, ptr @"_llgo_iface$vZQIEKY9NTKV50wpjIW4TLdy5d2nWtc2Lxm3TTPFcc0", align 8 br label %_llgo_22 _llgo_22: ; preds = %_llgo_21, %_llgo_20 diff --git a/compiler/cl/_testrt/typalias/out.ll b/compiler/cl/_testrt/typalias/out.ll index 976e8bac..1a1d2911 100644 --- a/compiler/cl/_testrt/typalias/out.ll +++ b/compiler/cl/_testrt/typalias/out.ll @@ -1,15 +1,13 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/typalias' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/typalias" %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } @"github.com/goplus/llgo/runtime/internal/runtime.cgoAlwaysFalse" = external global i1, align 1 -@main.format = global [10 x i8] zeroinitializer, align 1 -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format" = global [10 x i8] zeroinitializer, align 1 +@"github.com/goplus/llgo/compiler/cl/_testrt/typalias.init$guard" = global i1 false, align 1 -define void @main.Print(ptr %0) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.Print"(ptr %0) { _llgo_0: %1 = getelementptr inbounds { i32, i1 }, ptr %0, i32 0, i32 1 %2 = load i1, ptr %1, align 1 @@ -18,65 +16,59 @@ _llgo_0: _llgo_1: ; preds = %_llgo_0 %3 = getelementptr inbounds { i32, i1 }, ptr %0, i32 0, i32 0 %4 = load i32, ptr %3, align 4 - call void (ptr, ...) @printf(ptr @main.format, i32 %4) + call void (ptr, ...) @printf(ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i32 %4) br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define ptr @main._Cgo_ptr(ptr %0) { +define ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias._Cgo_ptr"(ptr %0) { _llgo_0: ret ptr %0 } declare void @runtime.cgoUse(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -declare void @main._cgoCheckResult(%"github.com/goplus/llgo/runtime/internal/runtime.eface") +declare void @"github.com/goplus/llgo/compiler/cl/_testrt/typalias._cgoCheckResult"(%"github.com/goplus/llgo/runtime/internal/runtime.eface") -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.init$guard", align 1 call void @syscall.init() - store i8 72, ptr @main.format, align 1 - store i8 101, ptr getelementptr inbounds (i8, ptr @main.format, i64 1), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 2), align 1 - store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 3), align 1 - store i8 111, ptr getelementptr inbounds (i8, ptr @main.format, i64 4), align 1 - store i8 32, ptr getelementptr inbounds (i8, ptr @main.format, i64 5), align 1 - store i8 37, ptr getelementptr inbounds (i8, ptr @main.format, i64 6), align 1 - store i8 100, ptr getelementptr inbounds (i8, ptr @main.format, i64 7), align 1 - store i8 10, ptr getelementptr inbounds (i8, ptr @main.format, i64 8), align 1 - store i8 0, ptr getelementptr inbounds (i8, ptr @main.format, i64 9), align 1 + store i8 72, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", align 1 + store i8 101, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i64 1), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i64 2), align 1 + store i8 108, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i64 3), align 1 + store i8 111, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i64 4), align 1 + store i8 32, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i64 5), align 1 + store i8 37, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i64 6), align 1 + store i8 100, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i64 7), align 1 + store i8 10, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i64 8), align 1 + store i8 0, ptr getelementptr inbounds (i8, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.format", i64 9), align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) - %3 = getelementptr inbounds { i32, i1 }, ptr %2, i32 0, i32 0 - %4 = getelementptr inbounds { i32, i1 }, ptr %2, i32 0, i32 1 - store i32 100, ptr %3, align 4 - store i1 true, ptr %4, align 1 - call void @main.Print(ptr %2) - ret i32 0 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8) + %1 = getelementptr inbounds { i32, i1 }, ptr %0, i32 0, i32 0 + %2 = getelementptr inbounds { i32, i1 }, ptr %0, i32 0, i32 1 + store i32 100, ptr %1, align 4 + store i1 true, ptr %2, align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/typalias.Print"(ptr %0) + ret void } declare void @printf(ptr, ...) declare void @syscall.init() -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) diff --git a/compiler/cl/_testrt/typed/out.ll b/compiler/cl/_testrt/typed/out.ll index e2d62e03..d8e2cd8c 100644 --- a/compiler/cl/_testrt/typed/out.ll +++ b/compiler/cl/_testrt/typed/out.ll @@ -1,149 +1,141 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/typed' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/typed" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/typed.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [5 x i8] c"hello", align 1 -@_llgo_main.T = linkonce global ptr null, align 8 -@1 = private unnamed_addr constant [4 x i8] c"main", align 1 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.T" = linkonce global ptr null, align 8 +@1 = private unnamed_addr constant [48 x i8] c"github.com/goplus/llgo/compiler/cl/_testrt/typed", align 1 @2 = private unnamed_addr constant [1 x i8] c"T", align 1 @_llgo_string = linkonce global ptr null, align 8 @3 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1 -@_llgo_main.A = linkonce global ptr null, align 8 +@"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.A" = linkonce global ptr null, align 8 @4 = private unnamed_addr constant [1 x i8] c"A", align 1 @_llgo_int = linkonce global ptr null, align 8 @"[2]_llgo_int" = linkonce global ptr null, align 8 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/typed.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typed.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/typed.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/typed.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/typed.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - %2 = load ptr, ptr @_llgo_main.T, align 8 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %3, align 8 - %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 - %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %4, ptr %3, 1 - %6 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, 0 - %7 = load ptr, ptr @_llgo_main.T, align 8 - %8 = icmp eq ptr %6, %7 - br i1 %8, label %_llgo_1, label %_llgo_2 + %0 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.T", align 8 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %1, align 8 + %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 + %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, ptr %1, 1 + %4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, 0 + %5 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.T", align 8 + %6 = icmp eq ptr %4, %5 + br i1 %6, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %9 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, 1 - %10 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %9, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %10) + %7 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, 1 + %8 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %7, align 8 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %8) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %11 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, 0 - %12 = load ptr, ptr @_llgo_string, align 8 - %13 = icmp eq ptr %11, %12 - br i1 %13, label %_llgo_3, label %_llgo_4 + %9 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, 0 + %10 = load ptr, ptr @_llgo_string, align 8 + %11 = icmp eq ptr %9, %10 + br i1 %11, label %_llgo_3, label %_llgo_4 _llgo_2: ; preds = %_llgo_0 - %14 = load ptr, ptr @_llgo_string, align 8 - %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 21 }, ptr %15, align 8 - %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %14, 0 - %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %16, ptr %15, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %17) + %12 = load ptr, ptr @_llgo_string, align 8 + %13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 21 }, ptr %13, align 8 + %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %12, 0 + %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %14, ptr %13, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %15) unreachable _llgo_3: ; preds = %_llgo_1 - %18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, 1 - %19 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %18, align 8 - %20 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.String" %19, 0 - %21 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %20, i1 true, 1 + %16 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %3, 1 + %17 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %16, align 8 + %18 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.String" %17, 0 + %19 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %18, i1 true, 1 br label %_llgo_5 _llgo_4: ; preds = %_llgo_1 br label %_llgo_5 _llgo_5: ; preds = %_llgo_4, %_llgo_3 - %22 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } [ %21, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ] - %23 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %22, 0 - %24 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %22, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %23) + %20 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } [ %19, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ] + %21 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %20, 0 + %22 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 } %20, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %21) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %24) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %22) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - %25 = alloca [2 x i64], align 8 - call void @llvm.memset(ptr %25, i8 0, i64 16, i1 false) - %26 = getelementptr inbounds i64, ptr %25, i64 0 - %27 = getelementptr inbounds i64, ptr %25, i64 1 - store i64 1, ptr %26, align 4 - store i64 2, ptr %27, align 4 - %28 = load [2 x i64], ptr %25, align 4 - %29 = load ptr, ptr @_llgo_main.A, align 8 - %30 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store [2 x i64] %28, ptr %30, align 4 - %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %29, 0 - %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %31, ptr %30, 1 - %33 = alloca [2 x i64], align 8 - call void @llvm.memset(ptr %33, i8 0, i64 16, i1 false) - %34 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %32, 0 - %35 = load ptr, ptr @_llgo_main.A, align 8 - %36 = icmp eq ptr %34, %35 - br i1 %36, label %_llgo_6, label %_llgo_7 + %23 = alloca [2 x i64], align 8 + call void @llvm.memset(ptr %23, i8 0, i64 16, i1 false) + %24 = getelementptr inbounds i64, ptr %23, i64 0 + %25 = getelementptr inbounds i64, ptr %23, i64 1 + store i64 1, ptr %24, align 4 + store i64 2, ptr %25, align 4 + %26 = load [2 x i64], ptr %23, align 4 + %27 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.A", align 8 + %28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store [2 x i64] %26, ptr %28, align 4 + %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %27, 0 + %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %29, ptr %28, 1 + %31 = alloca [2 x i64], align 8 + call void @llvm.memset(ptr %31, i8 0, i64 16, i1 false) + %32 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %30, 0 + %33 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.A", align 8 + %34 = icmp eq ptr %32, %33 + br i1 %34, label %_llgo_6, label %_llgo_7 _llgo_6: ; preds = %_llgo_5 - %37 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %32, 1 - %38 = load [2 x i64], ptr %37, align 4 - %39 = insertvalue { [2 x i64], i1 } undef, [2 x i64] %38, 0 - %40 = insertvalue { [2 x i64], i1 } %39, i1 true, 1 + %35 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %30, 1 + %36 = load [2 x i64], ptr %35, align 4 + %37 = insertvalue { [2 x i64], i1 } undef, [2 x i64] %36, 0 + %38 = insertvalue { [2 x i64], i1 } %37, i1 true, 1 br label %_llgo_8 _llgo_7: ; preds = %_llgo_5 br label %_llgo_8 _llgo_8: ; preds = %_llgo_7, %_llgo_6 - %41 = phi { [2 x i64], i1 } [ %40, %_llgo_6 ], [ zeroinitializer, %_llgo_7 ] - %42 = extractvalue { [2 x i64], i1 } %41, 0 - store [2 x i64] %42, ptr %33, align 4 - %43 = extractvalue { [2 x i64], i1 } %41, 1 - %44 = getelementptr inbounds i64, ptr %33, i64 0 + %39 = phi { [2 x i64], i1 } [ %38, %_llgo_6 ], [ zeroinitializer, %_llgo_7 ] + %40 = extractvalue { [2 x i64], i1 } %39, 0 + store [2 x i64] %40, ptr %31, align 4 + %41 = extractvalue { [2 x i64], i1 } %39, 1 + %42 = getelementptr inbounds i64, ptr %31, i64 0 + %43 = load i64, ptr %42, align 4 + %44 = getelementptr inbounds i64, ptr %31, i64 1 %45 = load i64, ptr %44, align 4 - %46 = getelementptr inbounds i64, ptr %33, i64 1 - %47 = load i64, ptr %46, align 4 + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %43) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %45) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %47) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32) - call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %43) + call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintBool"(i1 %41) call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10) - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/typed.init$after"() { _llgo_0: - %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, i64 24, i64 16, i64 0, i64 0) - %1 = load ptr, ptr @_llgo_main.T, align 8 + %0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, i64 24, i64 16, i64 0, i64 0) + %1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.T", align 8 %2 = icmp eq ptr %1, null br i1 %2, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - store ptr %0, ptr @_llgo_main.T, align 8 + store ptr %0, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.T", align 8 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 @@ -165,13 +157,13 @@ _llgo_5: ; preds = %_llgo_4 br label %_llgo_6 _llgo_6: ; preds = %_llgo_5, %_llgo_4 - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }, i64 17, i64 16, i64 0, i64 0) - %8 = load ptr, ptr @_llgo_main.A, align 8 + %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }, i64 17, i64 16, i64 0, i64 0) + %8 = load ptr, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.A", align 8 %9 = icmp eq ptr %8, null br i1 %9, label %_llgo_7, label %_llgo_8 _llgo_7: ; preds = %_llgo_6 - store ptr %7, ptr @_llgo_main.A, align 8 + store ptr %7, ptr @"_llgo_github.com/goplus/llgo/compiler/cl/_testrt/typed.A", align 8 br label %_llgo_8 _llgo_8: ; preds = %_llgo_7, %_llgo_6 diff --git a/compiler/cl/_testrt/unreachable/out.ll b/compiler/cl/_testrt/unreachable/out.ll index 28f8ad08..8c180a70 100644 --- a/compiler/cl/_testrt/unreachable/out.ll +++ b/compiler/cl/_testrt/unreachable/out.ll @@ -1,41 +1,33 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/unreachable' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/unreachable" -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/unreachable.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [7 x i8] c"Hello\0A\00", align 1 -define void @main.foo() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/unreachable.foo"() { _llgo_0: unreachable ret void } -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/unreachable.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/unreachable.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 + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/unreachable.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/unreachable.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() - call void @main.foo() - %2 = call i32 (ptr, ...) @printf(ptr @0) - ret i32 0 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/unreachable.foo"() + %0 = call i32 (ptr, ...) @printf(ptr @0) + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - declare i32 @printf(ptr, ...) diff --git a/compiler/cl/_testrt/unsafe/out.ll b/compiler/cl/_testrt/unsafe/out.ll index b0d07dba..732b5a67 100644 --- a/compiler/cl/_testrt/unsafe/out.ll +++ b/compiler/cl/_testrt/unsafe/out.ll @@ -1,267 +1,259 @@ -; ModuleID = 'main' -source_filename = "main" +; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/unsafe' +source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/unsafe" %"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr } %"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 } -@"main.init$guard" = global i1 false, align 1 -@__llgo_argc = global i32 0, align 4 -@__llgo_argv = global ptr null, align 8 +@"github.com/goplus/llgo/compiler/cl/_testrt/unsafe.init$guard" = global i1 false, align 1 @0 = private unnamed_addr constant [5 x i8] c"error", align 1 @_llgo_string = linkonce global ptr null, align 8 @1 = private unnamed_addr constant [4 x i8] c"abc\00", align 1 @2 = private unnamed_addr constant [3 x i8] c"abc", align 1 -define void @main.init() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/unsafe.init"() { _llgo_0: - %0 = load i1, ptr @"main.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/unsafe.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 - call void @"main.init$after"() + store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/unsafe.init$guard", align 1 + call void @"github.com/goplus/llgo/compiler/cl/_testrt/unsafe.init$after"() br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -define i32 @main(i32 %0, ptr %1) { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/unsafe.main"() { _llgo_0: - store i32 %0, ptr @__llgo_argc, align 4 - store ptr %1, ptr @__llgo_argv, align 8 - call void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - call void @main.init() br i1 false, label %_llgo_1, label %_llgo_2 _llgo_1: ; preds = %_llgo_0 - %2 = load ptr, ptr @_llgo_string, align 8 - %3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %3, align 8 - %4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %2, 0 - %5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %4, ptr %3, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %5) + %0 = load ptr, ptr @_llgo_string, align 8 + %1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %1, align 8 + %2 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %0, 0 + %3 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, ptr %1, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %3) unreachable _llgo_2: ; preds = %_llgo_0 br i1 false, label %_llgo_3, label %_llgo_4 _llgo_3: ; preds = %_llgo_2 - %6 = load ptr, ptr @_llgo_string, align 8 - %7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %7, align 8 - %8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %6, 0 - %9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, ptr %7, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %9) + %4 = load ptr, ptr @_llgo_string, align 8 + %5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %5, align 8 + %6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0 + %7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr %5, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %7) unreachable _llgo_4: ; preds = %_llgo_2 br i1 false, label %_llgo_5, label %_llgo_6 _llgo_5: ; preds = %_llgo_4 - %10 = load ptr, ptr @_llgo_string, align 8 - %11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %11, align 8 - %12 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %10, 0 - %13 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %12, ptr %11, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %13) + %8 = load ptr, ptr @_llgo_string, align 8 + %9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %9, align 8 + %10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %8, 0 + %11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %10, ptr %9, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %11) unreachable _llgo_6: ; preds = %_llgo_4 br i1 false, label %_llgo_7, label %_llgo_8 _llgo_7: ; preds = %_llgo_6 - %14 = load ptr, ptr @_llgo_string, align 8 - %15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %15, align 8 - %16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %14, 0 - %17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %16, ptr %15, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %17) + %12 = load ptr, ptr @_llgo_string, align 8 + %13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %13, align 8 + %14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %12, 0 + %15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %14, ptr %13, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %15) unreachable _llgo_8: ; preds = %_llgo_6 br i1 false, label %_llgo_9, label %_llgo_10 _llgo_9: ; preds = %_llgo_8 - %18 = load ptr, ptr @_llgo_string, align 8 - %19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %19, align 8 - %20 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %18, 0 - %21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %20, ptr %19, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %21) + %16 = load ptr, ptr @_llgo_string, align 8 + %17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %17, align 8 + %18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %16, 0 + %19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %18, ptr %17, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %19) unreachable _llgo_10: ; preds = %_llgo_8 br i1 false, label %_llgo_11, label %_llgo_12 _llgo_11: ; preds = %_llgo_10 - %22 = load ptr, ptr @_llgo_string, align 8 - %23 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %23, align 8 - %24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %22, 0 - %25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %24, ptr %23, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %25) + %20 = load ptr, ptr @_llgo_string, align 8 + %21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %21, align 8 + %22 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %20, 0 + %23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %22, ptr %21, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %23) unreachable _llgo_12: ; preds = %_llgo_10 br i1 false, label %_llgo_13, label %_llgo_14 _llgo_13: ; preds = %_llgo_12 - %26 = load ptr, ptr @_llgo_string, align 8 - %27 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %27, align 8 - %28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %26, 0 - %29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %28, ptr %27, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %29) + %24 = load ptr, ptr @_llgo_string, align 8 + %25 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %25, align 8 + %26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %24, 0 + %27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %26, ptr %25, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %27) unreachable _llgo_14: ; preds = %_llgo_12 br i1 false, label %_llgo_15, label %_llgo_16 _llgo_15: ; preds = %_llgo_14 - %30 = load ptr, ptr @_llgo_string, align 8 - %31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %31, align 8 - %32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %30, 0 - %33 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %32, ptr %31, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %33) + %28 = load ptr, ptr @_llgo_string, align 8 + %29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %29, align 8 + %30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %28, 0 + %31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %30, ptr %29, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %31) unreachable _llgo_16: ; preds = %_llgo_14 br i1 false, label %_llgo_17, label %_llgo_18 _llgo_17: ; preds = %_llgo_16 - %34 = load ptr, ptr @_llgo_string, align 8 - %35 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %35, align 8 - %36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %34, 0 - %37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %36, ptr %35, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %37) + %32 = load ptr, ptr @_llgo_string, align 8 + %33 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %33, align 8 + %34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %32, 0 + %35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %34, ptr %33, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %35) unreachable _llgo_18: ; preds = %_llgo_16 br i1 false, label %_llgo_19, label %_llgo_20 _llgo_19: ; preds = %_llgo_18 - %38 = load ptr, ptr @_llgo_string, align 8 - %39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %39, align 8 - %40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %38, 0 - %41 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %40, ptr %39, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %41) + %36 = load ptr, ptr @_llgo_string, align 8 + %37 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %37, align 8 + %38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %36, 0 + %39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %38, ptr %37, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %39) unreachable _llgo_20: ; preds = %_llgo_18 - %42 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 3 }) - %43 = xor i1 %42, true - br i1 %43, label %_llgo_21, label %_llgo_22 + %40 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.StringEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 3 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 3 }) + %41 = xor i1 %40, true + br i1 %41, label %_llgo_21, label %_llgo_22 _llgo_21: ; preds = %_llgo_20 - %44 = load ptr, ptr @_llgo_string, align 8 - %45 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %45, align 8 - %46 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %44, 0 - %47 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %46, ptr %45, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %47) + %42 = load ptr, ptr @_llgo_string, align 8 + %43 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %43, align 8 + %44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %42, 0 + %45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %44, ptr %43, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %45) unreachable _llgo_22: ; preds = %_llgo_20 - %48 = load i8, ptr @1, align 1 - %49 = icmp ne i8 %48, 97 - br i1 %49, label %_llgo_23, label %_llgo_26 + %46 = load i8, ptr @1, align 1 + %47 = icmp ne i8 %46, 97 + br i1 %47, label %_llgo_23, label %_llgo_26 _llgo_23: ; preds = %_llgo_25, %_llgo_26, %_llgo_22 - %50 = load ptr, ptr @_llgo_string, align 8 - %51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %51, align 8 - %52 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %50, 0 - %53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %52, ptr %51, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %53) + %48 = load ptr, ptr @_llgo_string, align 8 + %49 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %49, align 8 + %50 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %48, 0 + %51 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %50, ptr %49, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %51) unreachable _llgo_24: ; preds = %_llgo_25 - %54 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) - %55 = getelementptr inbounds i64, ptr %54, i64 0 - %56 = getelementptr inbounds i64, ptr %54, i64 1 - store i64 1, ptr %55, align 4 - store i64 2, ptr %56, align 4 - %57 = getelementptr inbounds i64, ptr %54, i64 0 - %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %57, 0 - %59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, i64 2, 1 - %60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59, i64 2, 2 - %61 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, 0 - %62 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, 1 - %63 = icmp sge i64 0, %62 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %63) - %64 = getelementptr inbounds i64, ptr %61, i64 0 - %65 = load i64, ptr %64, align 4 - %66 = icmp ne i64 %65, 1 - br i1 %66, label %_llgo_27, label %_llgo_29 + %52 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16) + %53 = getelementptr inbounds i64, ptr %52, i64 0 + %54 = getelementptr inbounds i64, ptr %52, i64 1 + store i64 1, ptr %53, align 4 + store i64 2, ptr %54, align 4 + %55 = getelementptr inbounds i64, ptr %52, i64 0 + %56 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %55, 0 + %57 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %56, i64 2, 1 + %58 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %57, i64 2, 2 + %59 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, 0 + %60 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, 1 + %61 = icmp sge i64 0, %60 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %61) + %62 = getelementptr inbounds i64, ptr %59, i64 0 + %63 = load i64, ptr %62, align 4 + %64 = icmp ne i64 %63, 1 + br i1 %64, label %_llgo_27, label %_llgo_29 _llgo_25: ; preds = %_llgo_26 - %67 = load i8, ptr getelementptr inbounds (i8, ptr @1, i64 2), align 1 - %68 = icmp ne i8 %67, 99 - br i1 %68, label %_llgo_23, label %_llgo_24 + %65 = load i8, ptr getelementptr inbounds (i8, ptr @1, i64 2), align 1 + %66 = icmp ne i8 %65, 99 + br i1 %66, label %_llgo_23, label %_llgo_24 _llgo_26: ; preds = %_llgo_22 - %69 = load i8, ptr getelementptr inbounds (i8, ptr @1, i64 1), align 1 - %70 = icmp ne i8 %69, 98 - br i1 %70, label %_llgo_23, label %_llgo_25 + %67 = load i8, ptr getelementptr inbounds (i8, ptr @1, i64 1), align 1 + %68 = icmp ne i8 %67, 98 + br i1 %68, label %_llgo_23, label %_llgo_25 _llgo_27: ; preds = %_llgo_29, %_llgo_24 - %71 = load ptr, ptr @_llgo_string, align 8 - %72 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %72, align 8 - %73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %71, 0 - %74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %73, ptr %72, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %74) + %69 = load ptr, ptr @_llgo_string, align 8 + %70 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %70, align 8 + %71 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %69, 0 + %72 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %71, ptr %70, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %72) unreachable _llgo_28: ; preds = %_llgo_29 - %75 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, 0 - %76 = load i64, ptr %75, align 4 - %77 = icmp ne i64 %76, 1 - br i1 %77, label %_llgo_30, label %_llgo_31 + %73 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, 0 + %74 = load i64, ptr %73, align 4 + %75 = icmp ne i64 %74, 1 + br i1 %75, label %_llgo_30, label %_llgo_31 _llgo_29: ; preds = %_llgo_24 - %78 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, 0 - %79 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, 1 - %80 = icmp sge i64 1, %79 - call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %80) - %81 = getelementptr inbounds i64, ptr %78, i64 1 - %82 = load i64, ptr %81, align 4 - %83 = icmp ne i64 %82, 2 - br i1 %83, label %_llgo_27, label %_llgo_28 + %76 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, 0 + %77 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %58, 1 + %78 = icmp sge i64 1, %77 + call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %78) + %79 = getelementptr inbounds i64, ptr %76, i64 1 + %80 = load i64, ptr %79, align 4 + %81 = icmp ne i64 %80, 2 + br i1 %81, label %_llgo_27, label %_llgo_28 _llgo_30: ; preds = %_llgo_28 - %84 = load ptr, ptr @_llgo_string, align 8 - %85 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %85, align 8 - %86 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %84, 0 - %87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %86, ptr %85, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %87) + %82 = load ptr, ptr @_llgo_string, align 8 + %83 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %83, align 8 + %84 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %82, 0 + %85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %84, ptr %83, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %85) unreachable _llgo_31: ; preds = %_llgo_28 br i1 icmp ne (i64 ptrtoint (ptr getelementptr (i8, ptr null, i64 1) to i64), i64 1), label %_llgo_32, label %_llgo_33 _llgo_32: ; preds = %_llgo_31 - %88 = load ptr, ptr @_llgo_string, align 8 - %89 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) - store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %89, align 8 - %90 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %88, 0 - %91 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %90, ptr %89, 1 - call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %91) + %86 = load ptr, ptr @_llgo_string, align 8 + %87 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 16) + store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 }, ptr %87, align 8 + %88 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %86, 0 + %89 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %88, ptr %87, 1 + call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %89) unreachable _llgo_33: ; preds = %_llgo_31 - ret i32 0 + ret void } -declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"() - -define void @"main.init$after"() { +define void @"github.com/goplus/llgo/compiler/cl/_testrt/unsafe.init$after"() { _llgo_0: %0 = load ptr, ptr @_llgo_string, align 8 %1 = icmp eq ptr %0, null