80 lines · plain
1# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o2# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/ret32.s -o %t.ret32.o3# RUN: wasm-ld --emit-relocs -o %t.wasm %t.o %t.ret32.o4# RUN: obj2yaml %t.wasm | FileCheck %s5 6.functype ret32 (f32) -> (i32)7 8unused_function:9 .functype unused_function () -> ()10 end_function11 12.globl _start13_start:14 .functype _start () -> ()15 f32.const 0.016 call ret3217 drop18 i32.const foo19 drop20 i32.const __stack_low21 drop22 end_function23 24.section .bss.data,"",@25.p2align 226foo:27 .int32 028 .size foo, 429 30.section .debug_info,"",@31.p2align 232.int32 unused_function33.int32 _start34.int32 035 36# CHECK: - Type: CODE37# CHECK-NEXT: Relocations:38# CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB39# CHECK-NEXT: Index: 140# CHECK-NEXT: Offset: 0x941 42# CHECK: - Type: DATA43# CHECK-NEXT: Segments:44# CHECK-NEXT: - SectionOffset: 845# CHECK-NEXT: InitFlags: 046# CHECK-NEXT: Offset:47# CHECK-NEXT: Opcode: I32_CONST48# CHECK-NEXT: Value: 6553649# CHECK-NEXT: Content: '00000000'50 51# There should be a single relocation in this section (just the live symbol)52# CHECK-NEXT: - Type: CUSTOM53# CHECK-NEXT: Relocations:54# CHECK-NEXT: - Type: R_WASM_FUNCTION_OFFSET_I3255# CHECK-NEXT: Index: 056# CHECK-NEXT: Offset: 0x457# CHECK-NEXT: Name: .debug_info58# CHECK-NEXT: Payload: FFFFFFFF020000000000000059 60# CHECK: - Type: CUSTOM61# CHECK-NEXT: Name: linking62# CHECK-NEXT: Version: 263# CHECK-NEXT: SymbolTable:64# CHECK-NEXT: - Index: 065# CHECK-NEXT: Kind: FUNCTION66# CHECK-NEXT: Name: _start67# CHECK-NEXT: Flags: [ ]68# CHECK-NEXT: Function: 069# CHECK-NEXT: - Index: 170# CHECK-NEXT: Kind: FUNCTION71# CHECK-NEXT: Name: ret3272# CHECK-NEXT: Flags: [ ]73# CHECK-NEXT: Function: 174# CHECK-NEXT: - Index: 275# CHECK-NEXT: Kind: DATA76# CHECK-NEXT: Name: __stack_low77# CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN, ABSOLUTE ]78# CHECK-NEXT: Size: 079# CHECK-NEXT: - Index: 380