xref: /llvm-project/lld/test/wasm/start-lib.s (revision 19261390cc3d0e58e0130ee4078fd1049889f510)
1// Based on lld/test/ELF/start-lib.s
2
3// RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t1.o
4// RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown \
5// RUN:   %p/Inputs/start-lib1.s -o %t2.o
6// RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown \
7// RUN:   %p/Inputs/start-lib2.s -o %t3.o
8
9// RUN: wasm-ld --no-gc-sections -o %t3 %t1.o %t2.o %t3.o
10// RUN: obj2yaml %t3 | FileCheck --check-prefix=TEST1 %s
11// TEST1: Name: foo
12// TEST1: Name: bar
13
14// RUN: wasm-ld --no-gc-sections -o %t3 %t1.o -u bar --start-lib %t2.o %t3.o
15// RUN: obj2yaml %t3 | FileCheck --check-prefix=TEST2 %s
16// TEST2-NOT: Name: foo
17// TEST2: Name: bar
18
19// RUN: wasm-ld --no-gc-sections -o %t3 %t1.o --start-lib %t2.o %t3.o
20// RUN: obj2yaml %t3 | FileCheck --check-prefix=TEST3 %s
21// TEST3-NOT: Name: foo
22// TEST3-NOT: Name: bar
23
24// RUN: not wasm-ld %t1.o --start-lib --start-lib 2>&1 | FileCheck -check-prefix=NESTED-LIB %s
25// NESTED-LIB: nested --start-lib
26
27// RUN: not wasm-ld --end-lib 2>&1 | FileCheck -check-prefix=END %s
28// END: stray --end-lib
29
30.globl _start
31_start:
32  .functype _start () -> ()
33  end_function
34