70 lines
2.6 KiB
LLVM
70 lines
2.6 KiB
LLVM
; ModuleID = 'github.com/goplus/llgo/cl/_testrt/closure'
|
|
source_filename = "github.com/goplus/llgo/cl/_testrt/closure"
|
|
|
|
@"github.com/goplus/llgo/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 @"github.com/goplus/llgo/cl/_testrt/closure.init"() {
|
|
_llgo_0:
|
|
%0 = load i1, ptr @"github.com/goplus/llgo/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 @"github.com/goplus/llgo/cl/_testrt/closure.init$guard", align 1
|
|
br label %_llgo_2
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|
ret void
|
|
}
|
|
|
|
define void @"github.com/goplus/llgo/cl/_testrt/closure.main"() {
|
|
_llgo_0:
|
|
call void @"github.com/goplus/llgo/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/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/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 @"github.com/goplus/llgo/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 @"github.com/goplus/llgo/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 @"github.com/goplus/llgo/cl/_testrt/closure.main$3"(ptr %0) {
|
|
_llgo_0:
|
|
%1 = load { ptr }, ptr %0, align 8
|
|
%2 = extractvalue { ptr } %1, 0
|
|
%3 = load { ptr, ptr }, ptr %2, align 8
|
|
%4 = extractvalue { ptr, ptr } %3, 1
|
|
%5 = extractvalue { ptr, ptr } %3, 0
|
|
call void %5(ptr %4, i64 100, i64 200)
|
|
ret void
|
|
}
|
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64)
|
|
|
|
define linkonce void @"__llgo_stub.github.com/goplus/llgo/cl/_testrt/closure.main$2"(ptr %0, i64 %1, i64 %2) {
|
|
_llgo_0:
|
|
tail call void @"github.com/goplus/llgo/cl/_testrt/closure.main$2"(i64 %1, i64 %2)
|
|
ret void
|
|
}
|
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64)
|
|
|
|
declare i32 @printf(ptr, ...)
|