1 ; Verify that the -u / --undefined option is able to pull in symbols from
2 ; an archive, and doesn't error when uses to pull in a symbol already loaded.
4 ; RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/ret64.s -o %t.o
5 ; RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/ret32.s -o %t2.o
6 ; RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/start.s -o %t.start.o
8 ; RUN: llvm-ar rcs %t2.a %t2.o
9 ; RUN: wasm-ld %t.start.o --no-gc-sections %t2.a %t.o -o %t.wasm -u ret32 --undefined ret64
10 ; RUN: obj2yaml %t.wasm | FileCheck %s
11 ; RUN: wasm-ld %t.start.o --no-gc-sections %t2.a %t.o -o %t2.wasm
12 ; RUN: obj2yaml %t2.wasm | FileCheck %s -check-prefix=NO-LOAD
15 ; CHECK-NEXT: FunctionNames:
16 ; CHECK-NEXT: - Index: 0
17 ; CHECK-NEXT: Name: __wasm_call_ctors
18 ; CHECK-NEXT: - Index: 1
19 ; CHECK-NEXT: Name: _start
20 ; CHECK-NEXT: - Index: 2
21 ; CHECK-NEXT: Name: ret64
22 ; CHECK-NEXT: - Index: 3
23 ; CHECK-NEXT: Name: ret32
24 ; CHECK-NEXT: GlobalNames:
25 ; CHECK-NEXT: - Index: 0
26 ; CHECK-NEXT: Name: __stack_pointer
30 ; NO-LOAD-NEXT: FunctionNames:
31 ; NO-LOAD-NEXT: - Index: 0
32 ; NO-LOAD-NEXT: Name: __wasm_call_ctors
33 ; NO-LOAD-NEXT: - Index: 1
34 ; NO-LOAD-NEXT: Name: _start
35 ; NO-LOAD-NEXT: - Index: 2
36 ; NO-LOAD-NEXT: Name: ret64
37 ; NO-LOAD-NEXT: GlobalNames:
38 ; NO-LOAD-NEXT: - Index: 0
39 ; NO-LOAD-NEXT: Name: __stack_pointer
42 ; Verify that referencing a symbol that is not found doesn't result in a link
43 ; failure. This matches the behaviour of the ELF linker.
44 ; RUN: wasm-ld %t.start.o -o %t.wasm -u symboldoesnotexist