1; RUN: llc -filetype=obj -o %t.o %s 2; RUN: llc -filetype=obj %p/Inputs/explicit-section.ll -o %t2.o 3; RUN: wasm-ld --export=get_start --export=get_end --export=foo --export=var1 %t.o %t2.o -o %t.wasm 4; RUN: obj2yaml %t.wasm | FileCheck %s 5; RUN: llvm-objdump -d --no-show-raw-insn %t.wasm | FileCheck %s --check-prefix=ASM 6 7target triple = "wasm32-unknown-unknown" 8 9@foo = global i32 3, section "mysection", align 4 10@bar = global i32 4, section "mysection", align 4 11 12@__start_mysection = external global ptr 13@__stop_mysection = external global ptr 14 15define ptr @get_start() { 16 ret ptr @__start_mysection 17} 18 19define ptr @get_end() { 20 ret ptr @__stop_mysection 21} 22 23define void @_start() { 24entry: 25 ret void 26} 27 28; CHECK: - Type: DATA 29; CHECK-NEXT: Segments: 30; CHECK-NEXT: - SectionOffset: 7 31; CHECK-NEXT: InitFlags: 0 32; CHECK-NEXT: Offset: 33; CHECK-NEXT: Opcode: I32_CONST 34; CHECK-NEXT: Value: 1024 35; CHECK-NEXT: Content: 03000000040000002A0000002B000000 36 37; ASM: 0000006e <get_start>: 38; ASM-EMPTY: 39; ASM-NEXT: 70: i32.const 1024 40; ASM-NEXT: 76: end 41 42; ASM: 00000077 <get_end>: 43; ASM-EMPTY: 44; ASM-NEXT: 79: i32.const 1040 45; ASM-NEXT: 7f: end 46