1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2 # RUN: wasm-ld -no-gc-sections --no-entry --export=__data_end %t.o -o %t.wasm
3 # RUN: obj2yaml %t.wasm | FileCheck %s
5 # Test that the data section is skipped entirely when there are only
20 # CHECK-NOT: - Type: DATA
22 # CHECK: - Type: GLOBAL
23 # CHECK-NEXT: Globals:
24 # CHECK-NEXT: - Index: 0
25 # CHECK-NEXT: Type: I32
26 # CHECK-NEXT: Mutable: true
27 # CHECK-NEXT: InitExpr:
28 # CHECK-NEXT: Opcode: I32_CONST
29 # CHECK-NEXT: Value: 67568
30 # CHECK-NEXT: - Index: 1
31 # CHECK-NEXT: Type: I32
32 # CHECK-NEXT: Mutable: false
33 # CHECK-NEXT: InitExpr:
34 # CHECK-NEXT: Opcode: I32_CONST
35 # CHECK-NEXT: Value: 2028
36 # CHECK-NEXT: - Type: EXPORT
37 # CHECK-NEXT: Exports:
38 # CHECK-NEXT: - Name: memory
39 # CHECK-NEXT: Kind: MEMORY
40 # CHECK-NEXT: Index: 0
41 # CHECK-NEXT: - Name: __data_end
42 # CHECK-NEXT: Kind: GLOBAL
43 # CHECK-NEXT: Index: 1
45 # CHECK-NOT: DataSegmentNames: