brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · a8a05b8 Raw
73 lines · plain
1# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s2# RUN: wasm-ld --experimental-pic -shared --shared-memory -o %t.so %t.o3# RUN: llvm-objdump -d --no-show-raw-insn --no-leading-addr %t.so | FileCheck %s4# RUN: obj2yaml %t.so | FileCheck %s --check-prefix=YAML5 6.section  .bss.foo,"",@7.globl  foo8.p2align  29foo:10  .int32  011  .size foo, 412 13.section  .data.bar,"",@14.globl  bar15.p2align  216bar:17  .int32  4218  .size bar, 419 20.section  .custom_section.target_features,"",@21  .int8 222  .int8 4323  .int8 724  .ascii  "atomics"25  .int8 4326  .int8 1127  .ascii  "bulk-memory"28 29# Verify that there is only a single data segment and no bss30# in the binary:31 32#      YAML:  - Type:            DATA{{$}}33# YAML-NEXT:    Segments:34# YAML-NEXT:      - SectionOffset:   335# YAML-NEXT:        InitFlags:       136# YAML-NEXT:        Content:         2A00000037# YAML-NEXT:  - Type:            CUSTOM38 39# CHECK:      <__wasm_init_memory>:40# CHECK-NEXT:    .local i3241# CHECK-NEXT:            global.get      042# CHECK-NEXT:            i32.const       843# CHECK-NEXT:            i32.add44# CHECK-NEXT:            local.set       045# CHECK-NEXT:            block46# CHECK-NEXT:            block47# CHECK-NEXT:            block48# CHECK-NEXT:            local.get       049# CHECK-NEXT:            i32.const       050# CHECK-NEXT:            i32.const       151# CHECK-NEXT:            i32.atomic.rmw.cmpxchg  052# CHECK-NEXT:            br_table        {0, 1, 2}       # 1: down to label153# CHECK-NEXT:                                            # 2: down to label054# CHECK-NEXT:            end55 56# Regular data gets initialized with memory.init57 58# CHECK-NEXT:            i32.const       059# CHECK-NEXT:            global.get      060# CHECK-NEXT:            i32.add61# CHECK-NEXT:            i32.const       062# CHECK-NEXT:            i32.const       463# CHECK-NEXT:            memory.init     0, 064 65# BSS gets initialized with memory.fill66 67# CHECK-NEXT:            i32.const       468# CHECK-NEXT:            global.get      069# CHECK-NEXT:            i32.add70# CHECK-NEXT:            i32.const       071# CHECK-NEXT:            i32.const       472# CHECK-NEXT:            memory.fill     073