46 lines · plain
1# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s2# RUN: wasm-ld %t.o %p/Inputs/libstub.so -o %t.wasm3# RUN: obj2yaml %t.wasm | FileCheck %s4 5# When the dependencies are missing the link fails6# RUN: not wasm-ld %t.o %p/Inputs/libstub-missing-dep.so -o %t.wasm 2>&1 | FileCheck --check-prefix=MISSING-DEP %s7 8# When the dependencies are missing the link fails9# MISSING-DEP: libstub-missing-dep.so: undefined symbol: missing_dep. Required by foo10# MISSING-DEP: libstub-missing-dep.so: undefined symbol: missing_dep2. Required by foo11 12# The function foo is defined in libstub.so but depend on foodep1 and foodep213.functype foo () -> ()14.import_name foo, foo_import15 16.globl foodep117foodep1:18 .functype foodep1 () -> ()19 end_function20 21.globl foodep222foodep2:23 .functype foodep2 () -> ()24 end_function25 26.globl _start27_start:28 .functype _start () -> ()29 call foo30 end_function31 32# CHECK: - Type: EXPORT33# CHECK-NEXT: Exports:34# CHECK-NEXT: - Name: memory35# CHECK-NEXT: Kind: MEMORY36# CHECK-NEXT: Index: 037# CHECK-NEXT: - Name: foodep138# CHECK-NEXT: Kind: FUNCTION39# CHECK-NEXT: Index: 140# CHECK-NEXT: - Name: foodep241# CHECK-NEXT: Kind: FUNCTION42# CHECK-NEXT: Index: 243# CHECK-NEXT: - Name: _start44# CHECK-NEXT: Kind: FUNCTION45# CHECK-NEXT: Index: 346