1# RUN: llvm-mc -triple=wasm32-unknown-unknown -filetype=obj < %s | obj2yaml | FileCheck %s 2 3# Tests use of externref type, including storing it in a global 4 5.globaltype my_global, externref 6 7.globl read_externref 8read_externref: 9 .functype read_externref () -> (externref) 10 global.get my_global 11 end_function 12 13.globl write_externref 14write_externref: 15 .functype write_externref (externref) -> () 16 local.get 0 17 global.set my_global 18 end_function 19 20.globl call_with_ref 21call_with_ref: 22 .functype call_with_ref () -> () 23 call read_externref 24 call write_externref 25 end_function 26 27my_global: 28 29# CHECK: - Type: GLOBAL 30# CHECK-NEXT: Globals: 31# CHECK-NEXT: - Index: 0 32# CHECK-NEXT: Type: EXTERNREF 33# CHECK-NEXT: Mutable: true 34# CHECK-NEXT: InitExpr: 35# CHECK-NEXT: Opcode: REF_NULL 36# CHECK-NEXT: Type: EXTERNREF 37