xref: /llvm-project/lld/test/wasm/lto/thin-archivecollision.ll (revision a35ebcf255046bc78ea86b3c524e0836425a1156)
1*39e024d9SSam Clegg; Based on lld/test/ELF/lto/thin-archivecollision.ll
2*39e024d9SSam Clegg
3*39e024d9SSam Clegg; RUN: opt -module-summary %s -o %t.o
4*39e024d9SSam Clegg; RUN: mkdir -p %t1 %t2
5*39e024d9SSam Clegg; RUN: opt -module-summary %p/Inputs/thin1.ll -o %t1/t.coll.o
6*39e024d9SSam Clegg; RUN: opt -module-summary %p/Inputs/thin2.ll -o %t2/t.coll.o
7*39e024d9SSam Clegg
8*39e024d9SSam Clegg; RUN: rm -f %t.a
9*39e024d9SSam Clegg; RUN: llvm-ar rcs %t.a %t1/t.coll.o %t2/t.coll.o
10*39e024d9SSam Clegg; RUN: wasm-ld %t.o %t.a -o %t
11*39e024d9SSam Clegg; RUN: obj2yaml %t | FileCheck %s
12*39e024d9SSam Clegg
13*39e024d9SSam Clegg; Check we handle this case correctly even in presence of --whole-archive.
14*39e024d9SSam Clegg; RUN: wasm-ld %t.o --whole-archive %t.a -o %t
15*39e024d9SSam Clegg; RUN: obj2yaml %t | FileCheck %s
16*39e024d9SSam Clegg
17*39e024d9SSam Clegg; CHECK: Name:            _start
18*39e024d9SSam Clegg; CHECK: Name:            foo
19*39e024d9SSam Clegg; CHECK: Name:            blah
20*39e024d9SSam Clegg
21*39e024d9SSam Cleggtarget triple = "wasm32-unknown-unknown"
22*39e024d9SSam Clegg
23*39e024d9SSam Cleggdefine i32 @_start() #0 {
24*39e024d9SSam Cleggentry:
25*39e024d9SSam Clegg  %call = call i32 @foo(i32 23)
26*39e024d9SSam Clegg  %call1 = call i32 @blah(i32 37)
27*39e024d9SSam Clegg  ret i32 0
28*39e024d9SSam Clegg}
29*39e024d9SSam Clegg
30*39e024d9SSam Cleggdeclare i32 @foo(i32) #1
31*39e024d9SSam Cleggdeclare i32 @blah(i32) #1
32*39e024d9SSam Clegg
33*39e024d9SSam Cleggattributes #0 = { noinline optnone }
34