1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2 # RUN: wasm-ld --experimental-pic -shared --shared-memory -o %t.so %t.o
3 # RUN: llvm-objdump -d --no-show-raw-insn --no-leading-addr %t.so | FileCheck %s
4 # RUN: obj2yaml %t.so | FileCheck %s --check-prefix=YAML
13 .section .data.bar,"",@
20 .section .custom_section.target_features,"",@
29 # Verify that there is only a single data segment and no bss
32 # YAML: - Type: DATA{{$}}
33 # YAML-NEXT: Segments:
34 # YAML-NEXT: - SectionOffset: 3
35 # YAML-NEXT: InitFlags: 1
36 # YAML-NEXT: Content: 2A000000
37 # YAML-NEXT: - Type: CUSTOM
39 # CHECK: <__wasm_init_memory>:
40 # CHECK-NEXT: .local i32
41 # CHECK-NEXT: global.get 0
42 # CHECK-NEXT: i32.const 8
44 # CHECK-NEXT: local.set 0
48 # CHECK-NEXT: local.get 0
49 # CHECK-NEXT: i32.const 0
50 # CHECK-NEXT: i32.const 1
51 # CHECK-NEXT: i32.atomic.rmw.cmpxchg 0
52 # CHECK-NEXT: br_table {0, 1, 2} # 1: down to label1
53 # CHECK-NEXT: # 2: down to label0
56 # Regular data gets initialized with memory.init
58 # CHECK-NEXT: i32.const 0
59 # CHECK-NEXT: global.get 0
61 # CHECK-NEXT: i32.const 0
62 # CHECK-NEXT: i32.const 4
63 # CHECK-NEXT: memory.init 0, 0
65 # BSS gets initialized with memory.fill
67 # CHECK-NEXT: i32.const 4
68 # CHECK-NEXT: global.get 0
70 # CHECK-NEXT: i32.const 0
71 # CHECK-NEXT: i32.const 4
72 # CHECK-NEXT: memory.fill 0