github.com/goplus/llgo@v0.8.3/cl/_testlibc/sqlite/out.ll (about)

     1  ; ModuleID = 'main'
     2  source_filename = "main"
     3  
     4  @"main.init$guard" = global ptr null
     5  @0 = private unnamed_addr constant [20 x i8] c"==> Error: (%d) %s\0A\00", align 1
     6  @__llgo_argc = global ptr null
     7  @__llgo_argv = global ptr null
     8  @1 = private unnamed_addr constant [9 x i8] c":memory:\00", align 1
     9  
    10  define void @main.check(i32 %0) {
    11  _llgo_0:
    12    %1 = icmp ne i32 %0, 0
    13    br i1 %1, label %_llgo_1, label %_llgo_2
    14  
    15  _llgo_1:                                          ; preds = %_llgo_0
    16    %2 = call ptr @sqlite3_errstr(i32 %0)
    17    %3 = call i32 (ptr, ...) @printf(ptr @0, i32 %0, ptr %2)
    18    call void @exit(i32 1)
    19    br label %_llgo_2
    20  
    21  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    22    ret void
    23  }
    24  
    25  define void @main.init() {
    26  _llgo_0:
    27    %0 = load i1, ptr @"main.init$guard", align 1
    28    br i1 %0, label %_llgo_2, label %_llgo_1
    29  
    30  _llgo_1:                                          ; preds = %_llgo_0
    31    store i1 true, ptr @"main.init$guard", align 1
    32    br label %_llgo_2
    33  
    34  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    35    ret void
    36  }
    37  
    38  define i32 @main(i32 %0, ptr %1) {
    39  _llgo_0:
    40    store i32 %0, ptr @__llgo_argc, align 4
    41    store ptr %1, ptr @__llgo_argv, align 8
    42    call void @"github.com/goplus/llgo/internal/runtime.init"()
    43    call void @main.init()
    44    %2 = call { ptr, i32 } @"github.com/goplus/llgo/c/sqlite.OpenV2"(ptr @1, i32 130, ptr null)
    45    %3 = extractvalue { ptr, i32 } %2, 0
    46    %4 = extractvalue { ptr, i32 } %2, 1
    47    call void @main.check(i32 %4)
    48    %5 = call i32 @sqlite3_close(ptr %3)
    49    ret i32 0
    50  }
    51  
    52  declare ptr @sqlite3_errstr(i32)
    53  
    54  declare i32 @printf(ptr, ...)
    55  
    56  declare void @exit(i32)
    57  
    58  declare void @"github.com/goplus/llgo/internal/runtime.init"()
    59  
    60  declare { ptr, i32 } @"github.com/goplus/llgo/c/sqlite.OpenV2"(ptr, i32, ptr)
    61  
    62  declare i32 @sqlite3_close(ptr)