1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2 # RUN: wasm-ld %t.o -o %t.wasm
3 # RUN: obj2yaml %t.wasm | FileCheck %s
9 .globaltype foo_global, i32
10 .globaltype bar_global, f32
11 .globaltype immutable_global, i32, immutable
14 .functype read_global () -> (i32)
15 global.get immutable_global
19 .functype write_global (i32) -> ()
27 .functype _start () -> ()
38 # CHECK: - Type: GLOBAL
39 # CHECK-NEXT: Globals:
40 # CHECK-NEXT: - Index: 0
41 # CHECK-NEXT: Type: I32
42 # CHECK-NEXT: Mutable: true
43 # CHECK-NEXT: InitExpr:
44 # CHECK-NEXT: Opcode: I32_CONST
45 # CHECK-NEXT: Value: 66560
46 # CHECK-NEXT: - Index: 1
47 # CHECK-NEXT: Type: I32
48 # CHECK-NEXT: Mutable: false
49 # CHECK-NEXT: InitExpr:
50 # CHECK-NEXT: Opcode: I32_CONST
51 # CHECK-NEXT: Value: 0
52 # CHECK-NEXT: - Index: 2
53 # CHECK-NEXT: Type: I32
54 # CHECK-NEXT: Mutable: true
55 # CHECK-NEXT: InitExpr:
56 # CHECK-NEXT: Opcode: I32_CONST
57 # CHECK-NEXT: Value: 0
58 # CHECK-NEXT: - Index: 3
59 # CHECK-NEXT: Type: F32
60 # CHECK-NEXT: Mutable: true
61 # CHECK-NEXT: InitExpr:
62 # CHECK-NEXT: Opcode: F32_CONST
63 # CHECK-NEXT: Value: 0