[lld] 4c2a46f - [lld/COFF] Make test/COFF/start-lib.ll use split-file

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 10:56:02 PST 2024


Author: Nico Weber
Date: 2024-12-17T13:55:50-05:00
New Revision: 4c2a46f5fe2eaa41f851ff4ca37dcc8794312542

URL: https://github.com/llvm/llvm-project/commit/4c2a46f5fe2eaa41f851ff4ca37dcc8794312542
DIFF: https://github.com/llvm/llvm-project/commit/4c2a46f5fe2eaa41f851ff4ca37dcc8794312542.diff

LOG: [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.

Added: 
    

Modified: 
    lld/test/COFF/start-lib.ll

Removed: 
    lld/test/COFF/Inputs/start-lib1.ll
    lld/test/COFF/Inputs/start-lib2.ll


################################################################################
diff  --git a/lld/test/COFF/Inputs/start-lib1.ll b/lld/test/COFF/Inputs/start-lib1.ll
deleted file mode 100644
index 3d4fe19daab9cd..00000000000000
--- a/lld/test/COFF/Inputs/start-lib1.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-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"}

diff  --git a/lld/test/COFF/Inputs/start-lib2.ll b/lld/test/COFF/Inputs/start-lib2.ll
deleted file mode 100644
index 830ec1d6d191b5..00000000000000
--- a/lld/test/COFF/Inputs/start-lib2.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-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"}

diff  --git a/lld/test/COFF/start-lib.ll b/lld/test/COFF/start-lib.ll
index ac12db067ffa82..f4f49ed4e4f6e6 100644
--- a/lld/test/COFF/start-lib.ll
+++ b/lld/test/COFF/start-lib.ll
@@ -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
@@ -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"}


        


More information about the llvm-commits mailing list