|
1 | 1 | ; 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 |
9 | 12 | ;
|
10 | 13 | ; RUN: lld-link -out:%t1.exe -entry:main -opt:noref -lldmap:%t1.map \
|
11 | 14 | ; RUN: %t.obj %t1.obj %t2.obj
|
|
37 | 40 | ; TEST3-NOT: {{ }}foo{{$}}
|
38 | 41 | ; TEST3-NOT: {{ }}bar{{$}}
|
39 | 42 |
|
| 43 | + |
| 44 | +#--- main.ll |
| 45 | + |
40 | 46 | target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
|
41 | 47 | target triple = "x86_64-pc-windows-msvc"
|
42 | 48 |
|
43 | 49 | define void @main() {
|
44 | 50 | ret void
|
45 | 51 | }
|
| 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