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

     1  ; ModuleID = 'main'
     2  source_filename = "main"
     3  
     4  %main.Foo = type { i32, i1 }
     5  
     6  @main.format = global [10 x i8] undef
     7  @"main.init$guard" = global ptr null
     8  @__llgo_argc = global ptr null
     9  @__llgo_argv = global ptr null
    10  
    11  define void @"(main.Foo).Print"(%main.Foo %0) {
    12  _llgo_0:
    13    %1 = alloca %main.Foo, align 8
    14    %2 = call ptr @"github.com/goplus/llgo/internal/runtime.Zeroinit"(ptr %1, i64 8)
    15    store %main.Foo %0, ptr %2, align 4
    16    %3 = getelementptr inbounds %main.Foo, ptr %2, i32 0, i32 1
    17    %4 = load i1, ptr %3, align 1
    18    br i1 %4, label %_llgo_1, label %_llgo_2
    19  
    20  _llgo_1:                                          ; preds = %_llgo_0
    21    %5 = getelementptr inbounds %main.Foo, ptr %2, i32 0, i32 0
    22    %6 = load i32, ptr %5, align 4
    23    call void (ptr, ...) @printf(ptr @main.format, i32 %6)
    24    br label %_llgo_2
    25  
    26  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    27    ret void
    28  }
    29  
    30  define void @"(*main.Foo).Print"(ptr %0) {
    31  _llgo_0:
    32    %1 = load %main.Foo, ptr %0, align 4
    33    call void @"(main.Foo).Print"(%main.Foo %1)
    34    ret void
    35  }
    36  
    37  define void @main.init() {
    38  _llgo_0:
    39    %0 = load i1, ptr @"main.init$guard", align 1
    40    br i1 %0, label %_llgo_2, label %_llgo_1
    41  
    42  _llgo_1:                                          ; preds = %_llgo_0
    43    store i1 true, ptr @"main.init$guard", align 1
    44    store i8 72, ptr @main.format, align 1
    45    store i8 101, ptr getelementptr inbounds (i8, ptr @main.format, i64 1), align 1
    46    store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 2), align 1
    47    store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 3), align 1
    48    store i8 111, ptr getelementptr inbounds (i8, ptr @main.format, i64 4), align 1
    49    store i8 32, ptr getelementptr inbounds (i8, ptr @main.format, i64 5), align 1
    50    store i8 37, ptr getelementptr inbounds (i8, ptr @main.format, i64 6), align 1
    51    store i8 100, ptr getelementptr inbounds (i8, ptr @main.format, i64 7), align 1
    52    store i8 10, ptr getelementptr inbounds (i8, ptr @main.format, i64 8), align 1
    53    store i8 0, ptr getelementptr inbounds (i8, ptr @main.format, i64 9), align 1
    54    br label %_llgo_2
    55  
    56  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    57    ret void
    58  }
    59  
    60  define i32 @main(i32 %0, ptr %1) {
    61  _llgo_0:
    62    store i32 %0, ptr @__llgo_argc, align 4
    63    store ptr %1, ptr @__llgo_argv, align 8
    64    call void @"github.com/goplus/llgo/internal/runtime.init"()
    65    call void @main.init()
    66    %2 = alloca %main.Foo, align 8
    67    %3 = call ptr @"github.com/goplus/llgo/internal/runtime.Zeroinit"(ptr %2, i64 8)
    68    %4 = getelementptr inbounds %main.Foo, ptr %3, i32 0, i32 0
    69    %5 = getelementptr inbounds %main.Foo, ptr %3, i32 0, i32 1
    70    store i32 100, ptr %4, align 4
    71    store i1 true, ptr %5, align 1
    72    %6 = load %main.Foo, ptr %3, align 4
    73    call void @"(main.Foo).Print"(%main.Foo %6)
    74    ret i32 0
    75  }
    76  
    77  declare ptr @"github.com/goplus/llgo/internal/runtime.Zeroinit"(ptr, i64)
    78  
    79  declare void @printf(ptr, ...)
    80  
    81  declare void @"github.com/goplus/llgo/internal/runtime.init"()