[llvm] 4286581 - [llvm-ar][test] Rename two tests and use correct thin command

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 07:14:04 PDT 2022


Author: gbreynoo
Date: 2022-04-19T15:13:37+01:00
New Revision: 42865819b22486963294434fb21b51ab3e6ebfa4

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

LOG: [llvm-ar][test] Rename two tests and use correct thin command

Two tests used the term "full archive" rather than "regular", these have
been updated including the test names. They now also use --thin rather
than the deprecated T. This change was made in preparation of D123142.

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

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

Modified: 
    llvm/test/tools/llvm-ar/flatten-thin-archive.test

Removed: 
    llvm/test/tools/llvm-ar/full-to-thin-archive.test
    llvm/test/tools/llvm-ar/thin-to-full-archive.test


################################################################################
diff  --git a/llvm/test/tools/llvm-ar/flatten-thin-archive.test b/llvm/test/tools/llvm-ar/flatten-thin-archive.test
index 887b2e27725b3..3d228ce609df7 100644
--- a/llvm/test/tools/llvm-ar/flatten-thin-archive.test
+++ b/llvm/test/tools/llvm-ar/flatten-thin-archive.test
@@ -1,19 +1,19 @@
 # XFAIL: system-aix
-# 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.
+## 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-d-plus-e.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
+# 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-d-plus-e.a %t.a
+# RUN: llvm-ar rcs --thin %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 rcs --thin %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
+# CHECK:      a.txt
+# CHECK-NEXT: b.txt
+# CHECK-NEXT: c.txt
+# CHECK-NEXT: -d-plus-e.a

diff  --git a/llvm/test/tools/llvm-ar/full-to-thin-archive.test b/llvm/test/tools/llvm-ar/full-to-thin-archive.test
deleted file mode 100644
index 8683dd16988fd..0000000000000
--- a/llvm/test/tools/llvm-ar/full-to-thin-archive.test
+++ /dev/null
@@ -1,15 +0,0 @@
-# XFAIL: system-aix
-## Test archives do not convert to thin archives.
-
-# RUN: rm -rf %t && mkdir -p %t
-# RUN: llvm-ar qc %t/archive.a %s
-# RUN: not llvm-ar qT %t/archive.a %s 2>&1 | FileCheck %s
-# RUN: not llvm-ar rT %t/archive.a %s 2>&1 | FileCheck %s
-
-# CHECK: error: cannot convert a regular archive to a thin one
-
-## Test that you can add a full archive's contents to a thin archive with 'L'
-# RUN: llvm-ar -TqcL %t/thin.a %t/archive.a
-# RUN: FileCheck --check-prefixes=THIN --input-file=%t/thin.a %s
-
-THIN: !<thin>

diff  --git a/llvm/test/tools/llvm-ar/regular-to-thin-archive.test b/llvm/test/tools/llvm-ar/regular-to-thin-archive.test
new file mode 100644
index 0000000000000..65e7aa9211eb5
--- /dev/null
+++ b/llvm/test/tools/llvm-ar/regular-to-thin-archive.test
@@ -0,0 +1,15 @@
+# XFAIL: system-aix
+## Test regular archives do not convert to thin archives.
+
+# RUN: rm -rf %t && mkdir -p %t
+# RUN: llvm-ar qc %t/archive.a %s
+# RUN: not llvm-ar q --thin %t/archive.a %s 2>&1 | FileCheck %s
+# RUN: not llvm-ar r --thin %t/archive.a %s 2>&1 | FileCheck %s
+
+# CHECK: error: cannot convert a regular archive to a thin one
+
+## Test that you can add a regular archive's contents to a thin archive with 'L'
+# RUN: llvm-ar -qcL --thin %t/thin.a %t/archive.a
+# RUN: FileCheck --check-prefixes=THIN --input-file=%t/thin.a %s
+
+THIN: !<thin>

diff  --git a/llvm/test/tools/llvm-ar/thin-to-full-archive.test b/llvm/test/tools/llvm-ar/thin-to-regular-archive.test
similarity index 58%
rename from llvm/test/tools/llvm-ar/thin-to-full-archive.test
rename to llvm/test/tools/llvm-ar/thin-to-regular-archive.test
index 89f5e6675432c..08b2e5253deeb 100644
--- a/llvm/test/tools/llvm-ar/thin-to-full-archive.test
+++ b/llvm/test/tools/llvm-ar/thin-to-regular-archive.test
@@ -1,9 +1,9 @@
 # XFAIL: system-aix
-## Test thin archives do not siletly convert to full archives on write.
+## Test thin archives do not siletly convert to regular archives on write.
 
-# RUN: rm -f %tthin.a %tfull.a 
+# RUN: rm -f %tthin.a %tregular.a 
 
-# RUN: llvm-ar -Trc %tthin.a %S/Inputs/a.txt
+# RUN: llvm-ar -rc --thin %tthin.a %S/Inputs/a.txt
 # RUN: FileCheck --check-prefixes=THIN --input-file=%tthin.a %s
 
 # RUN: llvm-ar -q %tthin.a %S/Inputs/b.txt
@@ -18,10 +18,10 @@
 # RUN: llvm-ar -d %tthin.a %S/Inputs/c.txt
 # RUN: FileCheck --check-prefixes=THIN --input-file=%tthin.a %s
 
-THIN: !<thin>
+# THIN: !<thin>
 
-## Test that you can add a thin archive's contents to a full archive with 'L'
-# RUN: llvm-ar -qcL %tfull.a %tthin.a
-# RUN: FileCheck --check-prefixes=FULL --input-file=%tfull.a %s
+## Test that you can add a thin archive's contents to a regular archive with 'L'
+# RUN: llvm-ar -qcL %tregular.a %tthin.a
+# RUN: FileCheck --check-prefixes=REGULAR --input-file=%tregular.a %s
 
-FULL: !<arch>
+REGULAR: !<arch>


        


More information about the llvm-commits mailing list