1 ; RUN: llc -O0 -filetype=obj %s -o - | llvm-readobj -r --expand-relocs - | FileCheck %s
5 ; CHECK-NEXT: Section (3) DATA {
6 ; CHECK-NEXT: Relocation {
7 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_LOCREL_I32 (23)
8 ; CHECK-NEXT: Offset: 0x6
9 ; CHECK-NEXT: Symbol: foo
10 ; CHECK-NEXT: Addend: 0
12 ; CHECK-NEXT: Relocation {
13 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_LOCREL_I32 (23)
14 ; CHECK-NEXT: Offset: 0xA
15 ; CHECK-NEXT: Symbol: fizz
16 ; CHECK-NEXT: Addend: 0
18 ; CHECK-NEXT: Relocation {
19 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_LOCREL_I32 (23)
20 ; CHECK-NEXT: Offset: 0x17
21 ; CHECK-NEXT: Symbol: foo
22 ; CHECK-NEXT: Addend: 4
27 target triple = "wasm32-unknown-unknown"
31 @foo = external global i32, align 4
32 @bar = constant i32 sub (
33 i32 ptrtoint (ptr @foo to i32),
34 i32 ptrtoint (ptr @bar to i32)
39 @fizz = constant i32 42, align 4, section ".sec2"
40 @addend = constant i32 sub (
41 i32 ptrtoint (ptr @foo to i32),
42 i32 ptrtoint (ptr @fizz to i32)
45 @x_sec = constant i32 sub (
46 i32 ptrtoint (ptr @fizz to i32),
47 i32 ptrtoint (ptr @x_sec to i32)