xref: /llvm-project-15.0.7/llvm/test/MC/WebAssembly/debuginfo-relocs.s (revision ad1f5457)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2# RUN: obj2yaml %t.o | FileCheck %s
3
4.functype undef () -> ()
5
6bar:
7    .functype bar () -> ()
8    end_function
9
10    .globl _start
11_start:
12    .functype _start () -> ()
13    call bar
14    end_function
15
16.section .debug_int,"",@
17.Ld:
18  .int32 1
19.size .Ld, 4
20
21.section .debug_info,"",@
22    .int32 bar
23    .int32 undef
24    .int32 .Ld
25
26## Test that relocations in metadata sections against both defined and undef
27## function symbols get R_WASM_FUNCTION_OFFSET relocations, and relocs against
28## data symbols get R_WASM_SECTION_OFFSET relocs.
29# CHECK:     - Type: CUSTOM
30# CHECK-NEXT:  Name: .debug_int
31# CHECK:     - Type: CUSTOM
32# CHECK-NEXT:    Relocations:
33# CHECK-NEXT:      - Type:            R_WASM_FUNCTION_OFFSET_I32
34# CHECK-NEXT:        Index:           0
35# CHECK-NEXT:        Offset:          0x0
36# CHECK-NEXT:      - Type:            R_WASM_FUNCTION_OFFSET_I32
37# CHECK-NEXT:        Index:           3
38# CHECK-NEXT:        Offset:          0x4
39# CHECK-NEXT:      - Type:            R_WASM_SECTION_OFFSET_I32
40# CHECK-NEXT:        Index:           2
41# CHECK-NEXT:        Offset:          0x8
42# CHECK-NEXT:         Name:            .debug_info
43
44

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026