[lld] e27a029 - [ELF][test] Clean up print-archive-stats.s
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 26 14:36:14 PDT 2022
Author: Fangrui Song
Date: 2022-07-26T14:36:09-07:00
New Revision: e27a029ed0f17de49b958d80fbbf9cf1622ea313
URL: https://github.com/llvm/llvm-project/commit/e27a029ed0f17de49b958d80fbbf9cf1622ea313
DIFF: https://github.com/llvm/llvm-project/commit/e27a029ed0f17de49b958d80fbbf9cf1622ea313.diff
LOG: [ELF][test] Clean up print-archive-stats.s
Added:
Modified:
lld/test/ELF/print-archive-stats.s
Removed:
################################################################################
diff --git a/lld/test/ELF/print-archive-stats.s b/lld/test/ELF/print-archive-stats.s
index 7f24cc671fff0..eb1ce5e4768ba 100644
--- a/lld/test/ELF/print-archive-stats.s
+++ b/lld/test/ELF/print-archive-stats.s
@@ -1,35 +1,37 @@
# REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
-# RUN: echo '.globl weak; weak:' | llvm-mc -filetype=obj -triple=x86_64 - -o %tweak.o
-# RUN: echo '.global foo; foo:' | llvm-mc -filetype=obj -triple=x86_64 - -o %t1.o
-# RUN: echo '.global bar; bar:' | llvm-mc -filetype=obj -triple=x86_64 - -o %t2.o
-# RUN: echo '.global baz; baz:' | llvm-mc -filetype=obj -triple=x86_64 - -o %t3.o
-# RUN: rm -f %tweak.a && llvm-ar rc %tweak.a %tweak.o
-# RUN: rm -f %t1.a && llvm-ar rc %t1.a %t1.o %t2.o %t3.o
+# RUN: rm -rf %t && split-file %s %t && cd %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
+# RUN: echo '.globl weak; weak:' | llvm-mc -filetype=obj -triple=x86_64 - -o weak.o
+# RUN: echo '.global foo; foo:' | llvm-mc -filetype=obj -triple=x86_64 - -o 1.o
+# RUN: echo '.global bar; bar:' | llvm-mc -filetype=obj -triple=x86_64 - -o 2.o
+# RUN: echo '.global baz; baz:' | llvm-mc -filetype=obj -triple=x86_64 - -o 3.o
+# RUN: rm -f weak.a && llvm-ar rc weak.a weak.o
+# RUN: rm -f 1.a && llvm-ar rc 1.a 1.o 2.o 3.o
-# RUN: ld.lld %t.o %tweak.a %t1.a --print-archive-stats=%t.txt -o /dev/null
-# RUN: FileCheck --input-file=%t.txt -DT=%t %s --match-full-lines --strict-whitespace
+# RUN: ld.lld a.o %t/weak.a 1.a --print-archive-stats=a.txt -o /dev/null
+# RUN: FileCheck --input-file=a.txt -DT=%t %s --match-full-lines --strict-whitespace
-## Fetches 0 member from %tweak.a and 2 members from %t1.a
+## Fetches 0 member from %t/weak.a and 2 members from %t1.a
# CHECK:members extracted archive
-# CHECK-NEXT:1 0 [[T]]weak.a
-# CHECK-NEXT:3 2 [[T]]1.a
+# CHECK-NEXT:1 0 [[T]]/weak.a
+# CHECK-NEXT:3 2 1.a
## - means stdout.
-# RUN: ld.lld %t.o %tweak.a %t1.a --print-archive-stats=- -o /dev/null |
diff %t.txt -
+# RUN: ld.lld a.o %t/weak.a 1.a --print-archive-stats=- -o /dev/null |
diff a.txt -
-## The second %t1.a has 0 fetched member.
-# RUN: ld.lld %t.o %tweak.a %t1.a %t1.a --print-archive-stats=- -o /dev/null | \
+## The second 1.a has 0 fetched member.
+# RUN: ld.lld a.o %t/weak.a 1.a 1.a --print-archive-stats=- -o /dev/null | \
# RUN: FileCheck --check-prefix=CHECK2 %s
# CHECK2: members extracted archive
# CHECK2-NEXT: 1 0 {{.*}}weak.a
-# CHECK2-NEXT: 3 2 {{.*}}1.a
-# CHECK2-NEXT: 3 0 {{.*}}1.a
+# CHECK2-NEXT: 3 2 1.a
+# CHECK2-NEXT: 3 0 1.a
-# RUN: not ld.lld -shared %t.o --print-archive-stats=/ -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
+# RUN: not ld.lld -shared a.o --print-archive-stats=/ -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
# ERR: error: --print-archive-stats=: cannot open /: {{.*}}
+#--- a.s
.globl _start
.weak weak
_start:
More information about the llvm-commits
mailing list