summaryrefslogtreecommitdiff
path: root/test/Object
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-16 16:41:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-16 16:41:00 +0000
commit7f2f94faeb04e0f97990d9d941745a630aaa5a54 (patch)
tree2dab4dc4b46bde27ba3e9a6607d10369c7df667c /test/Object
parent0659928fec02d5a953e528739cc036f7a68deb63 (diff)
downloadllvm-7f2f94faeb04e0f97990d9d941745a630aaa5a54.tar.gz
llvm-7f2f94faeb04e0f97990d9d941745a630aaa5a54.tar.bz2
llvm-7f2f94faeb04e0f97990d9d941745a630aaa5a54.tar.xz
Fix pr17056.
This makes llvm-nm ignore members that are not sufficiently aligned for lib/Object to handle. These archives are invalid. GNU AR is able to handle this, but in general just warns about broken archive members. We should probably start warning too, but for now just make sure llvm-nm exits with an 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Object')
-rw-r--r--test/Object/Inputs/corrupt-archive.abin0 -> 2698 bytes
-rw-r--r--test/Object/nm-archive.test6
2 files changed, 6 insertions, 0 deletions
diff --git a/test/Object/Inputs/corrupt-archive.a b/test/Object/Inputs/corrupt-archive.a
new file mode 100644
index 0000000000..f8940ff642
--- /dev/null
+++ b/test/Object/Inputs/corrupt-archive.a
Binary files differ
diff --git a/test/Object/nm-archive.test b/test/Object/nm-archive.test
index fbbf051b47..d875d6c991 100644
--- a/test/Object/nm-archive.test
+++ b/test/Object/nm-archive.test
@@ -33,3 +33,9 @@ RUN: llvm-nm -s %p/Inputs/archive-test.a-gnu-minimal
Don't reject an empty archive.
RUN: llvm-nm %p/Inputs/archive-test.a-empty
+
+This archive has an unaligned member and a unknown format member.
+GNU AR is able to parse the unaligned member and warns about the member with
+the unknown format. We should probably simply warn on both. For now just check
+that we don't produce an error.
+RUN: llvm-nm %p/Inputs/corrupt-archive.a