Files
llgo/cl/_testdata/fncall/out.ll

40 lines
966 B
LLVM
Raw Normal View History

2024-04-20 23:25:08 +08:00
; ModuleID = 'main'
source_filename = "main"
2024-04-20 23:15:10 +08:00
2024-04-23 01:16:31 +08:00
@"main.init$guard" = global ptr null
2024-04-20 23:15:10 +08:00
2024-04-22 15:09:08 +08:00
define void @main.init() {
2024-04-20 23:15:10 +08:00
_llgo_0:
2024-04-23 01:16:31 +08:00
%0 = load i1, ptr @"main.init$guard", align 1
2024-04-20 23:15:10 +08:00
br i1 %0, label %_llgo_2, label %_llgo_1
_llgo_1: ; preds = %_llgo_0
2024-04-23 01:16:31 +08:00
store i1 true, ptr @"main.init$guard", align 1
2024-04-20 23:15:10 +08:00
br label %_llgo_2
_llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}
define void @main() {
_llgo_0:
call void @"github.com/goplus/llgo/internal/runtime.init"()
call void @main.init()
%0 = call i64 @main.max(i64 1, i64 2)
ret void
}
2024-04-22 15:09:08 +08:00
define i64 @main.max(i64 %0, i64 %1) {
2024-04-20 23:15:10 +08:00
_llgo_0:
%2 = icmp sgt i64 %0, %1
br i1 %2, label %_llgo_1, label %_llgo_2
_llgo_1: ; preds = %_llgo_0
ret i64 %0
_llgo_2: ; preds = %_llgo_0
ret i64 %1
}
declare void @"github.com/goplus/llgo/internal/runtime.init"()