github.com/goplus/llgo@v0.8.3/cl/_testdata/vargs/out.ll (about)

     1  ; ModuleID = 'main'
     2  source_filename = "main"
     3  
     4  %"github.com/goplus/llgo/internal/runtime.iface" = type { ptr, ptr }
     5  %"github.com/goplus/llgo/internal/runtime.Slice" = type { ptr, i64, i64 }
     6  
     7  @"main.init$guard" = global ptr null
     8  @__llgo_argc = global ptr null
     9  @__llgo_argv = global ptr null
    10  @0 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
    11  
    12  define void @main.init() {
    13  _llgo_0:
    14    %0 = load i1, ptr @"main.init$guard", align 1
    15    br i1 %0, label %_llgo_2, label %_llgo_1
    16  
    17  _llgo_1:                                          ; preds = %_llgo_0
    18    store i1 true, ptr @"main.init$guard", align 1
    19    br label %_llgo_2
    20  
    21  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    22    ret void
    23  }
    24  
    25  define i32 @main(i32 %0, ptr %1) {
    26  _llgo_0:
    27    store i32 %0, ptr @__llgo_argc, align 4
    28    store ptr %1, ptr @__llgo_argv, align 8
    29    call void @"github.com/goplus/llgo/internal/runtime.init"()
    30    call void @main.init()
    31    %2 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 48)
    32    %3 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.iface", ptr %2, i64 0
    33    %4 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
    34    %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyInt"(ptr %4, i64 1)
    35    store %"github.com/goplus/llgo/internal/runtime.iface" %5, ptr %3, align 8
    36    %6 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.iface", ptr %2, i64 1
    37    %7 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
    38    %8 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyInt"(ptr %7, i64 2)
    39    store %"github.com/goplus/llgo/internal/runtime.iface" %8, ptr %6, align 8
    40    %9 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.iface", ptr %2, i64 2
    41    %10 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
    42    %11 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyInt"(ptr %10, i64 3)
    43    store %"github.com/goplus/llgo/internal/runtime.iface" %11, ptr %9, align 8
    44    %12 = call %"github.com/goplus/llgo/internal/runtime.Slice" @"github.com/goplus/llgo/internal/runtime.NewSlice3"(ptr %2, i64 16, i64 3, i64 0, i64 3, i64 3)
    45    call void @main.test(%"github.com/goplus/llgo/internal/runtime.Slice" %12)
    46    ret i32 0
    47  }
    48  
    49  define void @main.test(%"github.com/goplus/llgo/internal/runtime.Slice" %0) {
    50  _llgo_0:
    51    %1 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %0, 1
    52    br label %_llgo_1
    53  
    54  _llgo_1:                                          ; preds = %_llgo_2, %_llgo_0
    55    %2 = phi i64 [ -1, %_llgo_0 ], [ %3, %_llgo_2 ]
    56    %3 = add i64 %2, 1
    57    %4 = icmp slt i64 %3, %1
    58    br i1 %4, label %_llgo_2, label %_llgo_3
    59  
    60  _llgo_2:                                          ; preds = %_llgo_1
    61    %5 = icmp slt i64 %3, 0
    62    call void @"github.com/goplus/llgo/internal/runtime.AssertIndexRange"(i1 %5)
    63    %6 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %0, 0
    64    %7 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.iface", ptr %6, i64 %3
    65    %8 = load %"github.com/goplus/llgo/internal/runtime.iface", ptr %7, align 8
    66    %9 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
    67    %10 = call i64 @"github.com/goplus/llgo/internal/runtime.I2Int"(%"github.com/goplus/llgo/internal/runtime.iface" %8, ptr %9)
    68    %11 = call i32 (ptr, ...) @printf(ptr @0, i64 %10)
    69    br label %_llgo_1
    70  
    71  _llgo_3:                                          ; preds = %_llgo_1
    72    ret void
    73  }
    74  
    75  declare void @"github.com/goplus/llgo/internal/runtime.init"()
    76  
    77  declare ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64)
    78  
    79  declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)
    80  
    81  declare %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyInt"(ptr, i64)
    82  
    83  declare %"github.com/goplus/llgo/internal/runtime.Slice" @"github.com/goplus/llgo/internal/runtime.NewSlice3"(ptr, i64, i64, i64, i64, i64)
    84  
    85  declare void @"github.com/goplus/llgo/internal/runtime.AssertIndexRange"(i1)
    86  
    87  declare i64 @"github.com/goplus/llgo/internal/runtime.I2Int"(%"github.com/goplus/llgo/internal/runtime.iface", ptr)
    88  
    89  declare i32 @printf(ptr, ...)