1 # RUN: llvm-mc -triple=wasm32-unknown-unknown < %s | FileCheck %s
2 # RUN: llvm-mc -triple=wasm32-unknown-unknown -filetype=obj < %s | obj2yaml | FileCheck -check-prefix=BIN %s
4 # Tests creating an accessing actual wasm globals
8 .globaltype foo_global, i32
9 .globaltype global2, i64, immutable
10 .globaltype global3, f32
11 .globaltype global4, f64
14 .functype read_global () -> (i32)
19 .functype write_global (i32, i64, f32, f64) -> ()
35 # CHECK: .globl read_global
36 # CNEXT: .globl write_global
37 # CHECK: .globaltype foo_global, i32
42 # BIN-NEXT: - Index: 0
44 # BIN-NEXT: Mutable: true
46 # BIN-NEXT: Opcode: I32_CONST
48 # BIN-NEXT: - Index: 1
50 # BIN-NEXT: Mutable: false
52 # BIN-NEXT: Opcode: I64_CONST
56 # BIN-NEXT: Name: linking
57 # BIN-NEXT: Version: 2
58 # BIN-NEXT: SymbolTable:
59 # BIN-NEXT: - Index: 0
60 # BIN-NEXT: Kind: FUNCTION
61 # BIN-NEXT: Name: read_global
62 # BIN-NEXT: Flags: [ ]
63 # BIN-NEXT: Function: 0
64 # BIN-NEXT: - Index: 1
65 # BIN-NEXT: Kind: FUNCTION
66 # BIN-NEXT: Name: write_global
67 # BIN-NEXT: Flags: [ ]
68 # BIN-NEXT: Function: 1
69 # BIN-NEXT: - Index: 2
70 # BIN-NEXT: Kind: GLOBAL
71 # BIN-NEXT: Name: foo_global
72 # BIN-NEXT: Flags: [ BINDING_LOCAL ]
74 # BIN-NEXT: - Index: 3
75 # BIN-NEXT: Kind: GLOBAL
76 # BIN-NEXT: Name: global2
77 # BIN-NEXT: Flags: [ BINDING_LOCAL ]
79 # BIN-NEXT: - Index: 4
80 # BIN-NEXT: Kind: GLOBAL
81 # BIN-NEXT: Name: global3
82 # BIN-NEXT: Flags: [ BINDING_LOCAL ]
84 # BIN-NEXT: - Index: 5
85 # BIN-NEXT: Kind: GLOBAL
86 # BIN-NEXT: Name: global4
87 # BIN-NEXT: Flags: [ BINDING_LOCAL ]