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 4 5.globl _start 6.globl read_global 7.globl write_global 8 9.globaltype foo_global, i32 10.globaltype bar_global, f32 11 12read_global: 13 .functype read_global () -> (i32) 14 global.get foo_global 15 end_function 16 17write_global: 18 .functype write_global (i32) -> () 19 local.get 0 20 global.set foo_global 21 f32.const 1.0 22 global.set bar_global 23 end_function 24 25_start: 26 .functype _start () -> () 27 i32.const 1 28 call write_global 29 end_function 30 31foo_global: 32bar_global: 33 34# CHECK: - Type: GLOBAL 35# CHECK-NEXT: Globals: 36# CHECK-NEXT: - Index: 0 37# CHECK-NEXT: Type: I32 38# CHECK-NEXT: Mutable: true 39# CHECK-NEXT: InitExpr: 40# CHECK-NEXT: Opcode: I32_CONST 41# CHECK-NEXT: Value: 66560 42# CHECK-NEXT: - Index: 1 43# CHECK-NEXT: Type: I32 44# CHECK-NEXT: Mutable: true 45# CHECK-NEXT: InitExpr: 46# CHECK-NEXT: Opcode: I32_CONST 47# CHECK-NEXT: Value: 0 48# CHECK-NEXT: - Index: 2 49# CHECK-NEXT: Type: F32 50# CHECK-NEXT: Mutable: true 51# CHECK-NEXT: InitExpr: 52# CHECK-NEXT: Opcode: F32_CONST 53# CHECK-NEXT: Value: 0 54