github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/compiler/testdata/go1.20.ll (about)

     1  ; ModuleID = 'go1.20.go'
     2  source_filename = "go1.20.go"
     3  target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20"
     4  target triple = "wasm32-unknown-wasi"
     5  
     6  %runtime._string = type { ptr, i32 }
     7  
     8  ; Function Attrs: allockind("alloc,zeroed") allocsize(0)
     9  declare noalias nonnull ptr @runtime.alloc(i32, ptr, ptr) #0
    10  
    11  declare void @runtime.trackPointer(ptr nocapture readonly, ptr, ptr) #1
    12  
    13  ; Function Attrs: nounwind
    14  define hidden void @main.init(ptr %context) unnamed_addr #2 {
    15  entry:
    16    ret void
    17  }
    18  
    19  ; Function Attrs: nounwind
    20  define hidden ptr @main.unsafeSliceData(ptr %s.data, i32 %s.len, i32 %s.cap, ptr %context) unnamed_addr #2 {
    21  entry:
    22    %stackalloc = alloca i8, align 1
    23    call void @runtime.trackPointer(ptr %s.data, ptr nonnull %stackalloc, ptr undef) #3
    24    ret ptr %s.data
    25  }
    26  
    27  ; Function Attrs: nounwind
    28  define hidden %runtime._string @main.unsafeString(ptr dereferenceable_or_null(1) %ptr, i16 %len, ptr %context) unnamed_addr #2 {
    29  entry:
    30    %stackalloc = alloca i8, align 1
    31    %0 = icmp slt i16 %len, 0
    32    %1 = icmp eq ptr %ptr, null
    33    %2 = icmp ne i16 %len, 0
    34    %3 = and i1 %1, %2
    35    %4 = or i1 %3, %0
    36    br i1 %4, label %unsafe.String.throw, label %unsafe.String.next
    37  
    38  unsafe.String.next:                               ; preds = %entry
    39    %5 = zext i16 %len to i32
    40    %6 = insertvalue %runtime._string undef, ptr %ptr, 0
    41    %7 = insertvalue %runtime._string %6, i32 %5, 1
    42    call void @runtime.trackPointer(ptr %ptr, ptr nonnull %stackalloc, ptr undef) #3
    43    ret %runtime._string %7
    44  
    45  unsafe.String.throw:                              ; preds = %entry
    46    call void @runtime.unsafeSlicePanic(ptr undef) #3
    47    unreachable
    48  }
    49  
    50  declare void @runtime.unsafeSlicePanic(ptr) #1
    51  
    52  ; Function Attrs: nounwind
    53  define hidden ptr @main.unsafeStringData(ptr %s.data, i32 %s.len, ptr %context) unnamed_addr #2 {
    54  entry:
    55    %stackalloc = alloca i8, align 1
    56    call void @runtime.trackPointer(ptr %s.data, ptr nonnull %stackalloc, ptr undef) #3
    57    ret ptr %s.data
    58  }
    59  
    60  attributes #0 = { allockind("alloc,zeroed") allocsize(0) "alloc-family"="runtime.alloc" "target-features"="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
    61  attributes #1 = { "target-features"="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
    62  attributes #2 = { nounwind "target-features"="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
    63  attributes #3 = { nounwind }