Skip to content

Commit 4c2a46f

Browse files
committed
[lld/COFF] Make test/COFF/start-lib.ll use split-file
The two input files were only used by this one test, so put them inline. No behavior change.
1 parent 641fbf1 commit 4c2a46f

File tree

3 files changed

+43
-29
lines changed

3 files changed

+43
-29
lines changed

lld/test/COFF/Inputs/start-lib1.ll

-13
This file was deleted.

lld/test/COFF/Inputs/start-lib2.ll

-9
This file was deleted.

lld/test/COFF/start-lib.ll

+43-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
; REQUIRES: x86
2-
;
3-
; RUN: llc -filetype=obj %s -o %t.obj
4-
; RUN: llc -filetype=obj %p/Inputs/start-lib1.ll -o %t1.obj
5-
; RUN: llc -filetype=obj %p/Inputs/start-lib2.ll -o %t2.obj
6-
; RUN: opt -thinlto-bc %s -o %t.bc
7-
; RUN: opt -thinlto-bc %p/Inputs/start-lib1.ll -o %t1.bc
8-
; RUN: opt -thinlto-bc %p/Inputs/start-lib2.ll -o %t2.bc
2+
3+
; RUN: rm -rf %t.dir
4+
; RUN: split-file %s %t.dir
5+
6+
; RUN: llc -filetype=obj %t.dir/main.ll -o %t.obj
7+
; RUN: llc -filetype=obj %t.dir/start-lib1.ll -o %t1.obj
8+
; RUN: llc -filetype=obj %t.dir/start-lib2.ll -o %t2.obj
9+
; RUN: opt -thinlto-bc %t.dir/main.ll -o %t.bc
10+
; RUN: opt -thinlto-bc %t.dir/start-lib1.ll -o %t1.bc
11+
; RUN: opt -thinlto-bc %t.dir/start-lib2.ll -o %t2.bc
912
;
1013
; RUN: lld-link -out:%t1.exe -entry:main -opt:noref -lldmap:%t1.map \
1114
; RUN: %t.obj %t1.obj %t2.obj
@@ -37,9 +40,42 @@
3740
; TEST3-NOT: {{ }}foo{{$}}
3841
; TEST3-NOT: {{ }}bar{{$}}
3942

43+
44+
#--- main.ll
45+
4046
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
4147
target triple = "x86_64-pc-windows-msvc"
4248

4349
define void @main() {
4450
ret void
4551
}
52+
53+
54+
#--- start-lib1.ll
55+
56+
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
57+
target triple = "x86_64-pc-windows-msvc"
58+
59+
declare i32 @bar()
60+
61+
define i32 @foo() {
62+
%1 = call i32 () @bar()
63+
%2 = add i32 %1, 1
64+
ret i32 %2
65+
}
66+
67+
!llvm.linker.options = !{!0}
68+
!0 = !{!"/INCLUDE:foo"}
69+
70+
71+
#--- start-lib2.ll
72+
73+
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
74+
target triple = "x86_64-pc-windows-msvc"
75+
76+
define i32 @bar() {
77+
ret i32 1
78+
}
79+
80+
!llvm.linker.options = !{!0}
81+
!0 = !{!"/INCLUDE:bar"}

0 commit comments

Comments
 (0)