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 6target triple = "wasm32-unknown-unknown" 7 8@foo = global i32 3, section "mysection", align 4 9@bar = global i32 4, section "mysection", align 4 10 11@__start_mysection = external global i8* 12@__stop_mysection = external global i8* 13 14define i8** @get_start() { 15 ret i8** @__start_mysection 16} 17 18define i8** @get_end() { 19 ret i8** @__stop_mysection 20} 21 22define void @_start() { 23entry: 24 ret void 25} 26; CHECK: - Type: CODE 27; CHECK-NEXT: Functions: 28; CHECK-NEXT: - Index: 0 29; CHECK-NEXT: Locals: [] 30; CHECK-NEXT: Body: 4180888080000B 31; CHECK-NEXT: - Index: 1 32; CHECK-NEXT: Locals: [] 33; CHECK-NEXT: Body: 4190888080000B 34; CHECK-NEXT: - Index: 2 35; CHECK-NEXT: Locals: [] 36; CHECK-NEXT: Body: 0B 37; CHECK-NEXT: - Type: DATA 38; CHECK-NEXT: Segments: 39; CHECK-NEXT: - SectionOffset: 7 40; CHECK-NEXT: InitFlags: 0 41; CHECK-NEXT: Offset: 42; CHECK-NEXT: Opcode: I32_CONST 43; CHECK-NEXT: Value: 1024 44; CHECK-NEXT: Content: 03000000040000002A0000002B000000 45; CHECK-NEXT: - Type: CUSTOM 46; CHECK-NEXT: Name: name 47; CHECK-NEXT: FunctionNames: 48; CHECK-NEXT: - Index: 0 49; CHECK-NEXT: Name: get_start 50; CHECK-NEXT: - Index: 1 51; CHECK-NEXT: Name: get_end 52; CHECK-NEXT: - Index: 2 53; CHECK-NEXT: Name: _start 54