summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-ar/flatten-thin-archive.test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/tools/llvm-ar/flatten-thin-archive.test')
-rw-r--r--llvm/test/tools/llvm-ar/flatten-thin-archive.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-ar/flatten-thin-archive.test b/llvm/test/tools/llvm-ar/flatten-thin-archive.test
new file mode 100644
index 00000000000..430f48fe7c4
--- /dev/null
+++ b/llvm/test/tools/llvm-ar/flatten-thin-archive.test
@@ -0,0 +1,18 @@
+# This test creates a thin archive that contains a thin archive, a regular
+# archive, and a file.
+#
+# The inner thin archive should be flattened, but the regular archive should
+# not. The order of members in the archive should match the input order, with
+# flattened members appearing together.
+
+RUN: touch %t-a.txt %t-b.txt %t-c.txt %t-d.txt %t-e.txt
+RUN: rm -f %t-a-plus-b.a %t.a
+RUN: llvm-ar rcsT %t-a-plus-b.a %t-a.txt %t-b.txt
+RUN: llvm-ar rcs %t-d-plus-e.a %t-d.txt %t-e.txt
+RUN: llvm-ar rcsT %t.a %t-a-plus-b.a %t-c.txt %t-d-plus-e.a
+RUN: llvm-ar t %t.a | FileCheck %s
+
+CHECK: a.txt
+CHECK-NEXT: b.txt
+CHECK-NEXT: c.txt
+CHECK-NEXT: -d-plus-e.a
OpenPOWER on IntegriCloud