Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / WebAssembly / externref.s
blobf660e4627911ab1cac3556804ae7751b4861d05f
1 # RUN: llvm-mc -triple=wasm32-unknown-unknown -filetype=obj < %s | obj2yaml | FileCheck %s
3 # Tests use of externref type, including storing it in a global
5 .globaltype my_global, externref
7 .globl read_externref
8 read_externref:
9 .functype read_externref () -> (externref)
10 global.get my_global
11 end_function
13 .globl write_externref
14 write_externref:
15 .functype write_externref (externref) -> ()
16 local.get 0
17 global.set my_global
18 end_function
20 .globl call_with_ref
21 call_with_ref:
22 .functype call_with_ref () -> ()
23 call read_externref
24 call write_externref
25 end_function
27 my_global:
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