[PATCH] D107471: [llvm-ar] Add some test-cases for empty archives

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 5 01:34:52 PDT 2021


bd1976llvm updated this revision to Diff 364379.
bd1976llvm added a comment.

Arrg sorry! Uploaded an earlier incomplete revision by mistake.

- I removed the extract from empty thin archive test as you can't extract from thin archives.
- I addressed your review comments.

Thanks.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107471/new/

https://reviews.llvm.org/D107471

Files:
  llvm/test/tools/llvm-ar/display-empty.test
  llvm/test/tools/llvm-ar/print.test


Index: llvm/test/tools/llvm-ar/print.test
===================================================================
--- llvm/test/tools/llvm-ar/print.test
+++ llvm/test/tools/llvm-ar/print.test
@@ -8,6 +8,11 @@
 
 # RUN: llvm-ar -rc %t/archive.a %t/1.txt %t/2.txt %t/3.txt
 
+## Print empty archive:
+# RUN: llvm-ar cr %t/empty.a
+# RUN: llvm-ar p %t/empty.a 2>&1 | count 0
+# RUN: llvm-ar pv %t/empty.a 2>&1 | count 0
+
 ## Print without member:
 # RUN: llvm-ar p %t/archive.a \
 # RUN:   | FileCheck %s --check-prefix=WITHOUT --match-full-lines --implicit-check-not {{.}}
@@ -83,6 +88,11 @@
 
 # MISSING-FILE: error: '[[FILE]]' was not found
 
+## Print empty thin archive:
+# RUN: llvm-ar Trc %t/thin-archive-empty.a
+# RUN: llvm-ar p %t/thin-archive-empty.a 2>&1 | count 0
+# RUN: llvm-ar pv %t/thin-archive-empty.a 2>&1 | count 0
+
 ## Print thin archive:
 # RUN: llvm-ar Trc %t/thin-archive.a %t/1.txt %t/2.txt %t/3.txt
 # RUN: llvm-ar p %t/archive.a %t/2.txt \
Index: llvm/test/tools/llvm-ar/display-empty.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-ar/display-empty.test
@@ -0,0 +1,11 @@
+## Test Display of empty archives.
+
+# RUN: rm -rf %t && mkdir -p %t
+
+## Display empty archive:
+# RUN: llvm-ar cr %t/empty.a
+# RUN: llvm-ar tv %t/empty.a 2>&1 | count 0
+
+## Display empty thin archive:
+# RUN: llvm-ar Trc %t/thin-archive-empty.a
+# RUN: llvm-ar tv %t/thin-archive-empty.a 2>&1 | count 0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107471.364379.patch
Type: text/x-patch
Size: 1469 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210805/018b2d9b/attachment.bin>


More information about the llvm-commits mailing list