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

     1  ; ModuleID = 'main'
     2  source_filename = "main"
     3  
     4  @main.format = global [10 x i8] undef
     5  @"main.init$guard" = global ptr null
     6  @__llgo_argc = global ptr null
     7  @__llgo_argv = global ptr null
     8  
     9  define void @main.init() {
    10  _llgo_0:
    11    %0 = load i1, ptr @"main.init$guard", align 1
    12    br i1 %0, label %_llgo_2, label %_llgo_1
    13  
    14  _llgo_1:                                          ; preds = %_llgo_0
    15    store i1 true, ptr @"main.init$guard", align 1
    16    store i8 72, ptr @main.format, align 1
    17    store i8 101, ptr getelementptr inbounds (i8, ptr @main.format, i64 1), align 1
    18    store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 2), align 1
    19    store i8 108, ptr getelementptr inbounds (i8, ptr @main.format, i64 3), align 1
    20    store i8 111, ptr getelementptr inbounds (i8, ptr @main.format, i64 4), align 1
    21    store i8 32, ptr getelementptr inbounds (i8, ptr @main.format, i64 5), align 1
    22    store i8 37, ptr getelementptr inbounds (i8, ptr @main.format, i64 6), align 1
    23    store i8 100, ptr getelementptr inbounds (i8, ptr @main.format, i64 7), align 1
    24    store i8 10, ptr getelementptr inbounds (i8, ptr @main.format, i64 8), align 1
    25    store i8 0, ptr getelementptr inbounds (i8, ptr @main.format, i64 9), align 1
    26    br label %_llgo_2
    27  
    28  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    29    ret void
    30  }
    31  
    32  define i32 @main(i32 %0, ptr %1) {
    33  _llgo_0:
    34    store i32 %0, ptr @__llgo_argc, align 4
    35    store ptr %1, ptr @__llgo_argv, align 8
    36    call void @"github.com/goplus/llgo/internal/runtime.init"()
    37    call void @main.init()
    38    %2 = call i32 @strlen(ptr @main.format)
    39    call void (ptr, ...) @printf(ptr @main.format, i32 %2)
    40    ret i32 0
    41  }
    42  
    43  declare void @"github.com/goplus/llgo/internal/runtime.init"()
    44  
    45  declare i32 @strlen(ptr)
    46  
    47  declare void @printf(ptr, ...)