64 lines · plain
1# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s2# RUN: wasm-ld %t.o -o %t.wasm3# RUN: obj2yaml %t.wasm | FileCheck %s4 5.globl _start6.globl read_global7.globl write_global8 9.globaltype foo_global, i3210.globaltype bar_global, f3211.globaltype immutable_global, i32, immutable12 13read_global:14 .functype read_global () -> (i32)15 global.get immutable_global16 end_function17 18write_global:19 .functype write_global (i32) -> ()20 local.get 021 global.set foo_global22 f32.const 1.023 global.set bar_global24 end_function25 26_start:27 .functype _start () -> ()28 i32.const 129 call write_global30 call read_global31 drop32 end_function33 34foo_global:35bar_global:36immutable_global:37 38# CHECK: - Type: GLOBAL39# CHECK-NEXT: Globals:40# CHECK-NEXT: - Index: 041# CHECK-NEXT: Type: I3242# CHECK-NEXT: Mutable: true43# CHECK-NEXT: InitExpr:44# CHECK-NEXT: Opcode: I32_CONST45# CHECK-NEXT: Value: 6553646# CHECK-NEXT: - Index: 147# CHECK-NEXT: Type: I3248# CHECK-NEXT: Mutable: false49# CHECK-NEXT: InitExpr:50# CHECK-NEXT: Opcode: I32_CONST51# CHECK-NEXT: Value: 052# CHECK-NEXT: - Index: 253# CHECK-NEXT: Type: I3254# CHECK-NEXT: Mutable: true55# CHECK-NEXT: InitExpr:56# CHECK-NEXT: Opcode: I32_CONST57# CHECK-NEXT: Value: 058# CHECK-NEXT: - Index: 359# CHECK-NEXT: Type: F3260# CHECK-NEXT: Mutable: true61# CHECK-NEXT: InitExpr:62# CHECK-NEXT: Opcode: F32_CONST63# CHECK-NEXT: Value: 064