Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / wasm / stub-library-archive.s
blob7aacf676b343600d7e3ac7228e362911e6ab4e31
1 # RUN: split-file %s %t
2 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %t/main.s
3 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t/foodeps.o %t/foodeps.s
4 # RUN: rm -f %t/libfoodeps.a
5 # RUN: llvm-ar rcs %t/libfoodeps.a %t/foodeps.o
6 # RUN: wasm-ld %t.o %p/Inputs/libstub.so %t/libfoodeps.a -o %t.wasm
7 # RUN: obj2yaml %t.wasm | FileCheck %s
9 #--- main.s
11 # The function foo is defined in libstub.so but depends on foodep1 and foodep2
13 # foodep1 and foodep2 a defined libfoodeps.a(foodeps.o) but this function
14 # depeds on baz which is also defined in libstub.so.
16 .functype foo () -> ()
18 .globl _start
19 _start:
20 .functype _start () -> ()
21 call foo
22 end_function
24 .globl bazdep
25 bazdep:
26 .functype bazdep () -> ()
27 end_function
29 #--- foodeps.s
31 .functype baz () -> ()
33 .globl foodep1
34 foodep1:
35 .functype foodep1 () -> ()
36 call baz
37 end_function
39 .globl foodep2
40 foodep2:
41 .functype foodep2 () -> ()
42 end_function
44 # CHECK: - Type: EXPORT
45 # CHECK-NEXT: Exports:
46 # CHECK-NEXT: - Name: memory
47 # CHECK-NEXT: Kind: MEMORY
48 # CHECK-NEXT: Index: 0
49 # CHECK-NEXT: - Name: _start
50 # CHECK-NEXT: Kind: FUNCTION
51 # CHECK-NEXT: Index: 2
52 # CHECK-NEXT: - Name: bazdep
53 # CHECK-NEXT: Kind: FUNCTION
54 # CHECK-NEXT: Index: 3
55 # CHECK-NEXT: - Name: foodep1
56 # CHECK-NEXT: Kind: FUNCTION
57 # CHECK-NEXT: Index: 4
58 # CHECK-NEXT: - Name: foodep2
59 # CHECK-NEXT: Kind: FUNCTION
60 # CHECK-NEXT: Index: 5