brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · c22956f Raw
46 lines · plain
1; RUN: llc -filetype=obj -o %t.o %s2; RUN: llc -filetype=obj %p/Inputs/explicit-section.ll -o %t2.o3; RUN: wasm-ld --export=get_start --export=get_end --export=foo --export=var1 %t.o %t2.o -o %t.wasm4; RUN: obj2yaml %t.wasm | FileCheck %s5; RUN: llvm-objdump -d --no-show-raw-insn %t.wasm | FileCheck %s --check-prefix=ASM6 7target triple = "wasm32-unknown-unknown"8 9@foo = global i32 3, section "mysection", align 410@bar = global i32 4, section "mysection", align 411 12@__start_mysection = external global ptr13@__stop_mysection = external global ptr14 15define ptr @get_start() {16  ret ptr @__start_mysection17}18 19define ptr @get_end() {20  ret ptr @__stop_mysection21}22 23define void @_start()  {24entry:25  ret void26}27 28;      CHECK:   - Type:            DATA29; CHECK-NEXT:     Segments:30; CHECK-NEXT:       - SectionOffset:   831; CHECK-NEXT:         InitFlags:       032; CHECK-NEXT:         Offset:33; CHECK-NEXT:           Opcode:          I32_CONST34; CHECK-NEXT:           Value:           6553635; CHECK-NEXT:         Content:         03000000040000002A0000002B00000036 37;       ASM: 00000070 <get_start>:38; ASM-EMPTY:39;  ASM-NEXT:        72:     i32.const 6553640;  ASM-NEXT:        78:     end41 42;       ASM: 00000079 <get_end>:43; ASM-EMPTY:44;  ASM-NEXT:        7b:     i32.const 6555245;  ASM-NEXT:       81:     end46