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

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 10 02:35:58 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9e4d2b193a0b: [llvm-ar] Add some test-cases for empty archives (authored by Ben Dunbobbin <Ben.Dunbobbin at sony.com>).

Repository:
  rG LLVM Github Monorepo

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.365396.patch
Type: text/x-patch
Size: 1469 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210810/ea1c8f5d/attachment.bin>


More information about the llvm-commits mailing list