Skip to content

Commit

Permalink
[llvm-ar] Add some test-cases for empty archives
Browse files Browse the repository at this point in the history
We had coverage of empty archive in our downstream testsuite.
This adds those cases upstream.

Differential Revision: https://reviews.llvm.org/D107471
  • Loading branch information
bd1976bris committed Aug 10, 2021
1 parent 8392e8c commit 9e4d2b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions llvm/test/tools/llvm-ar/display-empty.test
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions llvm/test/tools/llvm-ar/print.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 {{.}}
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit 9e4d2b1

Please sign in to comment.