[llvm] 5e0f9d5 - [llvm-ar][test] Add to llvm-ar test coverage

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 02:58:32 PST 2020


Author: gbreynoo
Date: 2020-03-04T10:56:48Z
New Revision: 5e0f9d5d3c6be5106fa6f51e33bcb8776a55480e

URL: https://github.com/llvm/llvm-project/commit/5e0f9d5d3c6be5106fa6f51e33bcb8776a55480e
DIFF: https://github.com/llvm/llvm-project/commit/5e0f9d5d3c6be5106fa6f51e33bcb8776a55480e.diff

LOG: [llvm-ar][test] Add to llvm-ar test coverage

- Added handling of thin archives to symtab.test.
- Added handling of newlines to response.test.
- 62fa3332c9c1af1e66dfecd40f5b4e78882998b2 exposed behaviour
  regarding the use of -- on the command line. Added
  double-hyphen.test to cover this.

Differential Revision: https://reviews.llvm.org/D73333

Added: 
    llvm/test/tools/llvm-ar/double-hyphen.test

Modified: 
    llvm/test/tools/llvm-ar/response.test
    llvm/test/tools/llvm-ar/symtab.test

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-ar/double-hyphen.test b/llvm/test/tools/llvm-ar/double-hyphen.test
new file mode 100644
index 000000000000..edea626ce7f5
--- /dev/null
+++ b/llvm/test/tools/llvm-ar/double-hyphen.test
@@ -0,0 +1,9 @@
+## Test the use of "--" on the commandline
+
+# RUN: echo contents > %t.txt
+
+# RUN: rm -f %t.ar
+# RUN: llvm-ar rc -- %t.ar %t.txt 2>&1 | count 0
+
+# RUN: llvm-ar p %t.ar | FileCheck %s
+# CHECK: contents

diff  --git a/llvm/test/tools/llvm-ar/response.test b/llvm/test/tools/llvm-ar/response.test
index a08a63e88182..d9262481172a 100644
--- a/llvm/test/tools/llvm-ar/response.test
+++ b/llvm/test/tools/llvm-ar/response.test
@@ -17,6 +17,13 @@
 # RUN: llvm-ar @%t.response3.txt %t.txt
 # RUN: llvm-ar p %t3.a | FileCheck %s --check-prefix=CONTENTS
 
+## Newlines
+# RUN: echo contents > %t.txt
+# RUN: echo rc %t4.a > %t.newline.txt
+# RUN: echo %t.txt >> %t.newline.txt
+# RUN: llvm-ar @%t.newline.txt
+# RUN: llvm-ar p %t4.a | FileCheck %s --check-prefix=CONTENTS
+
 # CONTENTS: contents
 
 ## rsp-quoting

diff  --git a/llvm/test/tools/llvm-ar/symtab.test b/llvm/test/tools/llvm-ar/symtab.test
index 8dde4ede5813..098b769f4a4e 100644
--- a/llvm/test/tools/llvm-ar/symtab.test
+++ b/llvm/test/tools/llvm-ar/symtab.test
@@ -52,6 +52,12 @@
 # RUN: llvm-nm --print-armap %t-to-no-symtab.a \
 # RUN:   | FileCheck %s --check-prefix=NO-SYMTAB
 
+## Thin Archive:
+# RUN: rm -f %t-thin.a
+# RUN: llvm-ar rcT %t-thin.a %t.o
+# RUN: llvm-nm --print-armap %t-thin.a \
+# RUN:   | FileCheck %s --check-prefix=SYMTAB
+
 # SYMTAB:        symbol in
 # NO-SYMTAB-NOT: symbol in
 


        


More information about the llvm-commits mailing list