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

     1  ; ModuleID = 'pointer.go'
     2  source_filename = "pointer.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  ; Function Attrs: allockind("alloc,zeroed") allocsize(0)
     7  declare noalias nonnull ptr @runtime.alloc(i32, ptr, ptr) #0
     8  
     9  declare void @runtime.trackPointer(ptr nocapture readonly, ptr, ptr) #1
    10  
    11  ; Function Attrs: nounwind
    12  define hidden void @main.init(ptr %context) unnamed_addr #2 {
    13  entry:
    14    ret void
    15  }
    16  
    17  ; Function Attrs: nounwind
    18  define hidden [0 x i32] @main.pointerDerefZero(ptr %x, ptr %context) unnamed_addr #2 {
    19  entry:
    20    ret [0 x i32] zeroinitializer
    21  }
    22  
    23  ; Function Attrs: nounwind
    24  define hidden ptr @main.pointerCastFromUnsafe(ptr %x, ptr %context) unnamed_addr #2 {
    25  entry:
    26    %stackalloc = alloca i8, align 1
    27    call void @runtime.trackPointer(ptr %x, ptr nonnull %stackalloc, ptr undef) #3
    28    ret ptr %x
    29  }
    30  
    31  ; Function Attrs: nounwind
    32  define hidden ptr @main.pointerCastToUnsafe(ptr dereferenceable_or_null(4) %x, ptr %context) unnamed_addr #2 {
    33  entry:
    34    %stackalloc = alloca i8, align 1
    35    call void @runtime.trackPointer(ptr %x, ptr nonnull %stackalloc, ptr undef) #3
    36    ret ptr %x
    37  }
    38  
    39  ; Function Attrs: nounwind
    40  define hidden ptr @main.pointerCastToUnsafeNoop(ptr dereferenceable_or_null(1) %x, ptr %context) unnamed_addr #2 {
    41  entry:
    42    %stackalloc = alloca i8, align 1
    43    call void @runtime.trackPointer(ptr %x, ptr nonnull %stackalloc, ptr undef) #3
    44    ret ptr %x
    45  }
    46  
    47  attributes #0 = { allockind("alloc,zeroed") allocsize(0) "alloc-family"="runtime.alloc" "target-features"="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
    48  attributes #1 = { "target-features"="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
    49  attributes #2 = { nounwind "target-features"="+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext" }
    50  attributes #3 = { nounwind }