Skip to content

Commit

Permalink
[lld/COFF] Make test/COFF/start-lib.ll use split-file
Browse files Browse the repository at this point in the history
The two input files were only used by this one test, so put them inline.

No behavior change.
  • Loading branch information
nico committed Dec 17, 2024
1 parent 641fbf1 commit 4c2a46f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 29 deletions.
13 changes: 0 additions & 13 deletions lld/test/COFF/Inputs/start-lib1.ll

This file was deleted.

9 changes: 0 additions & 9 deletions lld/test/COFF/Inputs/start-lib2.ll

This file was deleted.

50 changes: 43 additions & 7 deletions lld/test/COFF/start-lib.ll
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
; REQUIRES: x86
;
; RUN: llc -filetype=obj %s -o %t.obj
; RUN: llc -filetype=obj %p/Inputs/start-lib1.ll -o %t1.obj
; RUN: llc -filetype=obj %p/Inputs/start-lib2.ll -o %t2.obj
; RUN: opt -thinlto-bc %s -o %t.bc
; RUN: opt -thinlto-bc %p/Inputs/start-lib1.ll -o %t1.bc
; RUN: opt -thinlto-bc %p/Inputs/start-lib2.ll -o %t2.bc

; RUN: rm -rf %t.dir
; RUN: split-file %s %t.dir

; RUN: llc -filetype=obj %t.dir/main.ll -o %t.obj
; RUN: llc -filetype=obj %t.dir/start-lib1.ll -o %t1.obj
; RUN: llc -filetype=obj %t.dir/start-lib2.ll -o %t2.obj
; RUN: opt -thinlto-bc %t.dir/main.ll -o %t.bc
; RUN: opt -thinlto-bc %t.dir/start-lib1.ll -o %t1.bc
; RUN: opt -thinlto-bc %t.dir/start-lib2.ll -o %t2.bc
;
; RUN: lld-link -out:%t1.exe -entry:main -opt:noref -lldmap:%t1.map \
; RUN: %t.obj %t1.obj %t2.obj
Expand Down Expand Up @@ -37,9 +40,42 @@
; TEST3-NOT: {{ }}foo{{$}}
; TEST3-NOT: {{ }}bar{{$}}


#--- main.ll

target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"

define void @main() {
ret void
}


#--- start-lib1.ll

target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"

declare i32 @bar()

define i32 @foo() {
%1 = call i32 () @bar()
%2 = add i32 %1, 1
ret i32 %2
}

!llvm.linker.options = !{!0}
!0 = !{!"/INCLUDE:foo"}


#--- start-lib2.ll

target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"

define i32 @bar() {
ret i32 1
}

!llvm.linker.options = !{!0}
!0 = !{!"/INCLUDE:bar"}

0 comments on commit 4c2a46f

Please sign in to comment.