1 # RUN: llvm-mc -triple=wasm32-unknown-unknown -filetype=obj -o %t.o %s
2 # RUN: wasm-ld %t.o -o %t.wasm
3 # RUN: obj2yaml %t.wasm | FileCheck %s
5 # Tests use of externref type, including storing it in a global
7 .globaltype my_global, externref
11 .functype read_externref () -> (externref)
15 .globl write_externref
17 .functype write_externref (externref) -> ()
26 .functype _start () -> ()
31 # CHECK: - Type: GLOBAL
32 # CHECK-NEXT: Globals:
33 # CHECK-NEXT: - Index: 0
34 # CHECK-NEXT: Type: I32
35 # CHECK-NEXT: Mutable: true
36 # CHECK-NEXT: InitExpr:
37 # CHECK-NEXT: Opcode: I32_CONST
38 # CHECK-NEXT: Value: 66560
39 # CHECK-NEXT: - Index: 1
40 # CHECK-NEXT: Type: EXTERNREF
41 # CHECK-NEXT: Mutable: true
42 # CHECK-NEXT: InitExpr:
43 # CHECK-NEXT: Opcode: REF_NULL
44 # CHECK-NEXT: Type: EXTERNREF