github.com/goplus/llgo@v0.8.3/cl/_testrt/gblarray/out.ll (about)

     1  ; ModuleID = 'main'
     2  source_filename = "main"
     3  
     4  %"github.com/goplus/llgo/internal/abi.Type" = type { i64, i64, i32, i8, i8, i8, i8, { ptr, ptr }, ptr, i32, i32 }
     5  
     6  @main.basicTypes = global [25 x ptr] undef
     7  @"main.init$guard" = global ptr null
     8  @main.sizeBasicTypes = global [25 x i64] undef
     9  @__llgo_argc = global ptr null
    10  @__llgo_argv = global ptr null
    11  @0 = private unnamed_addr constant [20 x i8] c"Kind: %d, Size: %d\0A\00", align 1
    12  
    13  define ptr @main.Basic(i64 %0) {
    14  _llgo_0:
    15    %1 = getelementptr inbounds ptr, ptr @main.basicTypes, i64 %0
    16    %2 = load ptr, ptr %1, align 8
    17    ret ptr %2
    18  }
    19  
    20  define ptr @main.basicType(i64 %0) {
    21  _llgo_0:
    22    %1 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 56)
    23    %2 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Type", ptr %1, i32 0, i32 0
    24    %3 = getelementptr inbounds i64, ptr @main.sizeBasicTypes, i64 %0
    25    %4 = load i64, ptr %3, align 4
    26    %5 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Type", ptr %1, i32 0, i32 2
    27    %6 = trunc i64 %0 to i32
    28    %7 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Type", ptr %1, i32 0, i32 6
    29    %8 = trunc i64 %0 to i8
    30    store i64 %4, ptr %2, align 4
    31    store i32 %6, ptr %5, align 4
    32    store i8 %8, ptr %7, align 1
    33    ret ptr %1
    34  }
    35  
    36  define void @main.init() {
    37  _llgo_0:
    38    %0 = load i1, ptr @"main.init$guard", align 1
    39    br i1 %0, label %_llgo_2, label %_llgo_1
    40  
    41  _llgo_1:                                          ; preds = %_llgo_0
    42    store i1 true, ptr @"main.init$guard", align 1
    43    call void @"github.com/goplus/llgo/internal/abi.init"()
    44    store i64 16, ptr getelementptr inbounds (i64, ptr @main.sizeBasicTypes, i64 24), align 4
    45    %1 = call ptr @main.basicType(i64 24)
    46    store ptr %1, ptr getelementptr inbounds (ptr, ptr @main.basicTypes, i64 24), align 8
    47    br label %_llgo_2
    48  
    49  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    50    ret void
    51  }
    52  
    53  define i32 @main(i32 %0, ptr %1) {
    54  _llgo_0:
    55    store i32 %0, ptr @__llgo_argc, align 4
    56    store ptr %1, ptr @__llgo_argv, align 8
    57    call void @"github.com/goplus/llgo/internal/runtime.init"()
    58    call void @main.init()
    59    %2 = call ptr @main.Basic(i64 24)
    60    %3 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Type", ptr %2, i32 0, i32 6
    61    %4 = load i8, ptr %3, align 1
    62    %5 = sext i8 %4 to i64
    63    %6 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Type", ptr %2, i32 0, i32 0
    64    %7 = load i64, ptr %6, align 4
    65    %8 = call i32 (ptr, ...) @printf(ptr @0, i64 %5, i64 %7)
    66    ret i32 0
    67  }
    68  
    69  declare ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64)
    70  
    71  declare void @"github.com/goplus/llgo/internal/abi.init"()
    72  
    73  declare void @"github.com/goplus/llgo/internal/runtime.init"()
    74  
    75  declare i32 @printf(ptr, ...)