[PATCH] D125785: [llvm-ar][test] Add regression test for special case of replace converting a regular to a full archive

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 02:58:42 PDT 2022


bd1976llvm updated this revision to Diff 432508.

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

https://reviews.llvm.org/D125785

Files:
  llvm/test/tools/llvm-ar/regular-to-thin-archive-special.test


Index: llvm/test/tools/llvm-ar/regular-to-thin-archive-special.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-ar/regular-to-thin-archive-special.test
@@ -0,0 +1,15 @@
+## Test regular archives do not convert to thin archives
+## in the special case of replacing a single file in an
+## archive with itself from the current directory.
+
+# RUN: rm -rf %t && mkdir -p %t && cd %t
+# RUN: echo "a" > a.txt
+# RUN: llvm-ar --format=gnu cr foo.a a.txt 2>&1
+
+## Check that an error is issued.
+# RUN: not llvm-ar --format=gnu cr --thin foo.a a.txt 2>&1 | FileCheck %s
+# CHECK: error: cannot convert a regular archive to a thin one
+
+## Check that the archive is still the correct flavor.
+# RUN: FileCheck --input-file=foo.a %s --check-prefix=REGULAR
+# REGULAR: !<arch>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125785.432508.patch
Type: text/x-patch
Size: 834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220527/8712a19d/attachment.bin>


More information about the llvm-commits mailing list