xref: /llvm-project/llvm/test/tools/llvm-readobj/wasm/relocations.test (revision fff9f049b2e91ce6e670d767866ee4670a4fed31)
1## Check how we print relocations.
2
3# RUN: llvm-readobj -r --expand-relocs %p/Inputs/trivial.obj.wasm \
4# RUN:   | FileCheck %s --check-prefix WASM
5
6# WASM:      Relocations [
7# WASM-NEXT:   Section (4) CODE {
8# WASM-NEXT:     Relocation {
9# WASM-NEXT:       Type: R_WASM_MEMORY_ADDR_SLEB (4)
10# WASM-NEXT:       Offset: 0x4
11# WASM-NEXT:       Symbol: .L.str
12# WASM-NEXT:       Addend: 0
13# WASM-NEXT:     }
14# WASM-NEXT:     Relocation {
15# WASM-NEXT:       Type: R_WASM_FUNCTION_INDEX_LEB (0)
16# WASM-NEXT:       Offset: 0xA
17# WASM-NEXT:       Symbol: puts
18# WASM-NEXT:     }
19# WASM-NEXT:     Relocation {
20# WASM-NEXT:       Type: R_WASM_FUNCTION_INDEX_LEB (0)
21# WASM-NEXT:       Offset: 0x11
22# WASM-NEXT:       Symbol: .LSomeOtherFunction_bitcast
23# WASM-NEXT:     }
24# WASM-NEXT:     Relocation {
25# WASM-NEXT:       Type: R_WASM_FUNCTION_INDEX_LEB (0)
26# WASM-NEXT:       Offset: 0x1E
27# WASM-NEXT:       Symbol: SomeOtherFunction
28# WASM-NEXT:     }
29# WASM-NEXT:   }
30# WASM-NEXT: ]
31