Skip to content

Commit 06482d7

Browse files
committed
add a test
1 parent 82a12e6 commit 06482d7

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

lld/test/wasm/Inputs/lib.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.functype f () -> ()
2+
.globl f
3+
.type f,@function
4+
f:
5+
.functype f () -> ()
6+
end_function

lld/test/wasm/dylink-non-pie.s

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.lib.o %p/Inputs/lib.s
2+
# RUN: wasm-ld -m wasm32 --experimental-pic -shared --no-entry %t.lib.o -o %t.lib.so
3+
# RUN: llvm-mc -filetype=obj -mattr=+reference-types -triple=wasm32-unknown-unknown -o %t.o %s
4+
# RUN: wasm-ld -m wasm32 --features=mutable-globals -Bdynamic --export-table --growable-table --export-memory --export=__stack_pointer --export=__heap_base --export=__heap_end --entry=_start %t.o %t.lib.so -o %t.wasm
5+
# RUN: obj2yaml %t.wasm | FileCheck %s
6+
7+
.tabletype __indirect_function_table, funcref
8+
.globaltype __memory_base, i32, immutable
9+
10+
.functype f () -> ()
11+
.functype _start () -> ()
12+
.globl _start
13+
.type _start,@function
14+
_start:
15+
.functype _start () -> ()
16+
global.get __memory_base
17+
i32.const f_p@MBREL
18+
i32.add
19+
i32.load 0
20+
call_indirect __indirect_function_table, () -> ()
21+
end_function
22+
23+
.section .data.f_p,"",@
24+
.globl f_p
25+
f_p:
26+
.int32 f
27+
.size f_p, 4
28+
29+
# CHECK: Sections:
30+
# CHECK-NEXT: - Type: CUSTOM
31+
# CHECK-NEXT: Name: dylink.0
32+
33+
# CHECK: - Type: EXPORT
34+
# CHECK: - Name: __wasm_apply_data_relocs
35+
# CHECK-NEXT: Kind: FUNCTION

0 commit comments

Comments
 (0)