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

     1  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
     2  target triple = "x86_64--linux"
     3  
     4  @main.v1 = global i1 0
     5  @main.v2 = global i1 0
     6  @"reflect/types.type:named:main.foo" = private constant { i8, ptr, ptr } { i8 34, ptr @"reflect/types.type:pointer:named:main.foo", ptr @"reflect/types.type:basic:int" }, align 4
     7  @"reflect/types.type:pointer:named:main.foo" = external constant { i8, ptr }
     8  @"reflect/types.typeid:named:main.foo" = external constant i8
     9  @"reflect/types.type:basic:int" = private constant { i8, ptr } { i8 2, ptr @"reflect/types.type:pointer:basic:int" }, align 4
    10  @"reflect/types.type:pointer:basic:int" = external constant { i8, ptr }
    11  
    12  
    13  declare i1 @runtime.typeAssert(ptr, ptr, ptr, ptr)
    14  
    15  define void @runtime.initAll() unnamed_addr {
    16  entry:
    17    call void @main.init()
    18    ret void
    19  }
    20  
    21  define internal void @main.init() unnamed_addr {
    22  entry:
    23    ; Test type asserts.
    24    %typecode = call i1 @runtime.typeAssert(ptr @"reflect/types.type:named:main.foo", ptr @"reflect/types.typeid:named:main.foo", ptr undef, ptr null)
    25    store i1 %typecode, ptr @main.v1
    26    %typecode2 = call i1 @runtime.typeAssert(ptr null, ptr @"reflect/types.typeid:named:main.foo", ptr undef, ptr null)
    27    store i1 %typecode2, ptr @main.v2
    28    ret void
    29  }