Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / wasm / lto / stub-library.s
blob20e2a62211413a408f28cc30d229ab09bbad1f51
1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2 # RUN: llvm-as %S/Inputs/foo.ll -o %t1.o
3 # RUN: wasm-ld %t.o %t1.o %p/Inputs/stub.so -o %t.wasm
4 # RUN: obj2yaml %t.wasm | FileCheck %s
6 # The function `bar` is declared in stub.so and depends on `foo`, which happens
7 # be in an LTO object.
8 # This verifies that stub library dependencies (required exports) can be defined
9 # in LTO objects.
10 .functype bar () -> ()
12 .globl _start
13 _start:
14 .functype _start () -> ()
15 call bar
16 end_function
18 # CHECK: Imports:
19 # CHECK-NEXT: - Module: env
20 # CHECK-NEXT: Field: bar
21 # CHECK-NEXT: Kind: FUNCTION
22 # CHECK-NEXT: SigIndex: 0
24 # CHECK: Exports:
25 # CHECK-NEXT: - Name: memory
26 # CHECK-NEXT: Kind: MEMORY
27 # CHECK-NEXT: Index: 0
28 # CHECK-NEXT: - Name: _start
29 # CHECK-NEXT: Kind: FUNCTION
30 # CHECK-NEXT: Index: 1
31 # CHECK-NEXT: - Name: foo
32 # CHECK-NEXT: Kind: FUNCTION
33 # CHECK-NEXT: Index: 2