diff --git a/llvm/test/tools/llvm-ar/display-empty.test b/llvm/test/tools/llvm-ar/display-empty.test new file mode 100644 --- /dev/null +++ b/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 diff --git a/llvm/test/tools/llvm-ar/print.test b/llvm/test/tools/llvm-ar/print.test --- a/llvm/test/tools/llvm-ar/print.test +++ b/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 \