File tree Expand file tree Collapse file tree 2 files changed +31
-19
lines changed Expand file tree Collapse file tree 2 files changed +31
-19
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments