Skip to content

Commit b2f227c

Browse files
committed
[lld][WebAssembly] Convert test to assembly. NFC.
Differential Revision: https://reviews.llvm.org/D102264
1 parent 97e04d4 commit b2f227c

File tree

2 files changed

+31
-19
lines changed

2 files changed

+31
-19
lines changed

lld/test/wasm/reloc-addend.ll

Lines changed: 0 additions & 19 deletions
This file was deleted.

lld/test/wasm/reloc-addend.s

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2+
# RUN: wasm-ld -r -o %t.wasm %t.o
3+
# RUN: obj2yaml %t.wasm | FileCheck %s
4+
5+
.hidden foo
6+
.hidden bar
7+
.globl foo
8+
.globl bar
9+
10+
# Similar to what would be generated from: `int foo[76]`
11+
.section .bss.foo,"",@
12+
.p2align 4
13+
foo:
14+
.skip 304
15+
.size foo, 304
16+
17+
# bar contains a pointer to the 16th element of foo, which happens to be 64
18+
# bytes in. This generates an addend of 64 which is the value at which signed
19+
# and unsigned LEB encodes will differ.
20+
.section .data.bar,"",@
21+
.p2align 2
22+
bar:
23+
.int32 foo+64
24+
.size bar, 4
25+
26+
# CHECK: - Type: DATA
27+
# CHECK-NEXT: Relocations:
28+
# CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
29+
# CHECK-NEXT: Index: 0
30+
# CHECK-NEXT: Offset: 0x6
31+
# CHECK-NEXT: Addend: 64

0 commit comments

Comments
 (0)