[update_cc_test_checks] Add test for missing handling of mangled names
[llvm-project.git] / lld / test / wasm / stub-library.s
blobb972003c5b05db69e464a770cd0676907164a2a8
1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2 # RUN: wasm-ld %t.o %p/Inputs/libstub.so -o %t.wasm
3 # RUN: obj2yaml %t.wasm | FileCheck %s
5 # When the dependencies are missing the link fails
6 # RUN: not wasm-ld %t.o %p/Inputs/libstub-missing-dep.so -o %t.wasm 2>&1 | FileCheck --check-prefix=MISSING-DEP %s
8 # When the dependencies are missing the link fails
9 # MISSING-DEP: libstub-missing-dep.so: undefined symbol: missing_dep. Required by foo
10 # MISSING-DEP: libstub-missing-dep.so: undefined symbol: missing_dep2. Required by foo
12 # The function foo is defined in libstub.so but depend on foodep1 and foodep2
13 .functype foo () -> ()
14 .import_name foo, foo_import
16 .globl foodep1
17 foodep1:
18 .functype foodep1 () -> ()
19 end_function
21 .globl foodep2
22 foodep2:
23 .functype foodep2 () -> ()
24 end_function
26 .globl _start
27 _start:
28 .functype _start () -> ()
29 call foo
30 end_function
32 # CHECK: - Type: EXPORT
33 # CHECK-NEXT: Exports:
34 # CHECK-NEXT: - Name: memory
35 # CHECK-NEXT: Kind: MEMORY
36 # CHECK-NEXT: Index: 0
37 # CHECK-NEXT: - Name: foodep1
38 # CHECK-NEXT: Kind: FUNCTION
39 # CHECK-NEXT: Index: 1
40 # CHECK-NEXT: - Name: foodep2
41 # CHECK-NEXT: Kind: FUNCTION
42 # CHECK-NEXT: Index: 2
43 # CHECK-NEXT: - Name: _start
44 # CHECK-NEXT: Kind: FUNCTION
45 # CHECK-NEXT: Index: 3