[llvm] c913c55 - [llvm-ar][test] add special case of replace converting a regular to a thin archive

Ben Dunbobbin via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 03:08:37 PDT 2022


Author: Ben Dunbobbin
Date: 2022-05-27T11:06:44+01:00
New Revision: c913c5598b026f0968f3c25db14e232c5b52277e

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

LOG: [llvm-ar][test] add special case of replace converting a regular to a thin archive

Add a regression test for:
  https://github.com/llvm/llvm-project/issues/55527

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

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

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-ar/regular-to-thin-archive-special.test b/llvm/test/tools/llvm-ar/regular-to-thin-archive-special.test
new file mode 100644
index 0000000000000..f7b037d3f43e1
--- /dev/null
+++ b/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>


        


More information about the llvm-commits mailing list