44 lines · plain
1# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s2# RUN: obj2yaml %t.o | FileCheck %s3 4.functype undef () -> ()5 6bar:7 .functype bar () -> ()8 end_function9 10 .globl _start11_start:12 .functype _start () -> ()13 call bar14 end_function15 16.section .debug_int,"",@17.Ld:18 .int32 119.size .Ld, 420 21.section .debug_info,"",@22 .int32 bar23 .int32 undef24 .int32 .Ld25 26## Test that relocations in metadata sections against both defined and undef27## function symbols get R_WASM_FUNCTION_OFFSET relocations, and relocs against28## data symbols get R_WASM_SECTION_OFFSET relocs.29# CHECK: - Type: CUSTOM30# CHECK-NEXT: Name: .debug_int31# CHECK: - Type: CUSTOM32# CHECK-NEXT: Relocations:33# CHECK-NEXT: - Type: R_WASM_FUNCTION_OFFSET_I3234# CHECK-NEXT: Index: 035# CHECK-NEXT: Offset: 0x036# CHECK-NEXT: - Type: R_WASM_FUNCTION_OFFSET_I3237# CHECK-NEXT: Index: 338# CHECK-NEXT: Offset: 0x439# CHECK-NEXT: - Type: R_WASM_SECTION_OFFSET_I3240# CHECK-NEXT: Index: 241# CHECK-NEXT: Offset: 0x842# CHECK-NEXT: Name: .debug_info43 44