summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-10-17 11:34:29 +0000
committerFangrui Song <maskray@google.com>2019-10-17 11:34:29 +0000
commita69cc92cb5083d9d9f33c19587db1cdcab742637 (patch)
tree5fcf46cd2e5afa7c6fdfe2bcce08fb030c65aa12 /llvm/test/Object
parent9dce25a9fa953cec1b89009226cdc463166a7ad4 (diff)
downloadbcm5719-llvm-a69cc92cb5083d9d9f33c19587db1cdcab742637.tar.gz
bcm5719-llvm-a69cc92cb5083d9d9f33c19587db1cdcab742637.zip
[llvm-ar] Implement the O modifier: display member offsets inside the archive
Since GNU ar 2.31, the 't' operation prints member offsets beside file names if the 'O' modifier is specified. 'O' is ignored for thin archives. Reviewed By: gbreynoo, ruiu Differential Revision: https://reviews.llvm.org/D69087 llvm-svn: 375106
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/archive-thin-create.test3
-rw-r--r--llvm/test/Object/archive-toc.test14
2 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/Object/archive-thin-create.test b/llvm/test/Object/archive-thin-create.test
index 55abe0002f9..e705d0ee2b7 100644
--- a/llvm/test/Object/archive-thin-create.test
+++ b/llvm/test/Object/archive-thin-create.test
@@ -9,6 +9,9 @@ RUN: llvm-ar qcT foo/libtest.a foo/test1.o
RUN: llvm-ar qcT foo/libtest.a foo/test2.o
RUN: llvm-ar t foo/libtest.a | FileCheck --match-full-lines %s
+O (displaying member offsets) is ignored for thin archives.
+RUN: llvm-ar tO foo/libtest.a | FileCheck --match-full-lines %s
+
CHECK: foo/test1.o
CHECK: foo/test1.o
CHECK: foo/test2.o
diff --git a/llvm/test/Object/archive-toc.test b/llvm/test/Object/archive-toc.test
index fcc7fe5312a..29f0bacfc3d 100644
--- a/llvm/test/Object/archive-toc.test
+++ b/llvm/test/Object/archive-toc.test
@@ -46,3 +46,17 @@ RUN: env TZ=GMT llvm-ar tv Inputs/thin-path.a | FileCheck %s --check-prefix=THIN
THINPATH: rw-r--r-- 0/0 1224 Jan 1 00:00 1970 Inputs/test.o
THINPATH-NEXT: rw-r--r-- 0/0 1224 Jan 1 00:00 1970 Inputs/t/test2.o
+
+RUN: llvm-ar tO Inputs/GNU.a | FileCheck %s --check-prefix=GNU-O --strict-whitespace
+
+GNU-O: {{^}}evenlen 0x10c
+GNU-O-NEXT: {{^}}oddlen 0x150
+GNU-O-NEXT: {{^}}very_long_bytecode_file_name.bc 0x194
+GNU-O-NEXT: {{^}}IsNAN.o 0x78a
+
+RUN: env TZ=GMT llvm-ar tvO Inputs/GNU.a | FileCheck %s --check-prefix=GNU-VO --strict-whitespace
+
+GNU-VO: rw-r--r-- 500/500 8 Nov 19 02:57 2004 evenlen 0x10c
+GNU-VO-NEXT: rw-r--r-- 500/500 7 Nov 19 02:57 2004 oddlen 0x150
+GNU-VO-NEXT: rwxr-xr-x 500/500 1465 Nov 19 03:01 2004 very_long_bytecode_file_name.bc 0x194
+GNU-VO-NEXT: rw-r--r-- 500/500 2280 Nov 19 03:04 2004 IsNAN.o 0x78a
OpenPOWER on IntegriCloud