60 lines
2.4 KiB
LLVM
60 lines
2.4 KiB
LLVM
; ModuleID = 'main'
|
|
source_filename = "main"
|
|
|
|
%"github.com/goplus/llgo/internal/runtime.Slice" = type { ptr, i64, i64 }
|
|
|
|
@main.a = global ptr null
|
|
@main.b = global ptr null
|
|
@main.c = global ptr null
|
|
@"main.init$guard" = global ptr null
|
|
|
|
define void @main.init() {
|
|
_llgo_0:
|
|
%0 = load i1, ptr @"main.init$guard", align 1
|
|
br i1 %0, label %_llgo_2, label %_llgo_1
|
|
|
|
_llgo_1: ; preds = %_llgo_0
|
|
store i1 true, ptr @"main.init$guard", align 1
|
|
store i64 9223372036854775807, ptr @main.a, align 4
|
|
store i64 -9223372036854775808, ptr @main.b, align 4
|
|
store i64 -1, ptr @main.c, align 4
|
|
br label %_llgo_2
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|
ret void
|
|
}
|
|
|
|
define void @main() {
|
|
_llgo_0:
|
|
call void @main.init()
|
|
%0 = call ptr @"github.com/goplus/llgo/internal/runtime.Alloc"(i64 16)
|
|
%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 = call %"github.com/goplus/llgo/internal/runtime.Slice" @"github.com/goplus/llgo/internal/runtime.NewSlice"(ptr %0, i64 4, i64 4)
|
|
%6 = call i64 @"github.com/goplus/llgo/internal/runtime.SliceLen"(%"github.com/goplus/llgo/internal/runtime.Slice" %5)
|
|
%7 = call ptr @"github.com/goplus/llgo/internal/runtime.Alloc"(i64 16)
|
|
%8 = getelementptr inbounds i64, ptr %7, i64 0
|
|
store i64 1, ptr %8, align 4
|
|
%9 = getelementptr inbounds i64, ptr %7, i64 1
|
|
store i64 2, ptr %9, align 4
|
|
%10 = getelementptr inbounds i64, ptr %7, i64 2
|
|
store i64 3, ptr %10, align 4
|
|
%11 = getelementptr inbounds i64, ptr %7, i64 3
|
|
store i64 4, ptr %11, align 4
|
|
%12 = call %"github.com/goplus/llgo/internal/runtime.Slice" @"github.com/goplus/llgo/internal/runtime.NewSlice"(ptr %7, i64 4, i64 4)
|
|
%13 = call i64 @"github.com/goplus/llgo/internal/runtime.SliceLen"(%"github.com/goplus/llgo/internal/runtime.Slice" %12)
|
|
ret void
|
|
}
|
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.Alloc"(i64)
|
|
|
|
declare %"github.com/goplus/llgo/internal/runtime.Slice" @"github.com/goplus/llgo/internal/runtime.NewSlice"(ptr, i64, i64)
|
|
|
|
declare i64 @"github.com/goplus/llgo/internal/runtime.SliceLen"(%"github.com/goplus/llgo/internal/runtime.Slice")
|