1; RUN: llc -filetype=obj %s -o %t.o
2; RUN: wasm-ld -r -o %t.wasm %t.o
3; RUN: obj2yaml %t.wasm | FileCheck %s
4
5target triple = "wasm32-unknown-unknown"
6
7@foo = hidden global [76 x i32] zeroinitializer, align 16
8
9; bar points to the 16th element, which happens to be 64 bytes
10; This generates an addend of 64 which, is the value at which
11; signed and unsigned LEB encodes will differ.
12@bar = hidden local_unnamed_addr global i32* getelementptr inbounds ([76 x i32], [76 x i32]* @foo, i32 0, i32 16), align 4
13
14; CHECK:        - Type:            DATA
15; CHECK-NEXT:     Relocations:
16; CHECK-NEXT:       - Type:            R_WASM_MEMORY_ADDR_I32
17; CHECK-NEXT:         Index:           0
18; CHECK-NEXT:         Offset:          0x6
19; CHECK-NEXT:         Addend:          64
20