summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-08-02 22:58:55 +0000
committerKevin Enderby <enderby@apple.com>2016-08-02 22:58:55 +0000
commit395cc09444b114bfb0f860bcd5c3d0365e7ca18c (patch)
tree4226a5b54049be8f2c34517cc70b6c84bb52535c /llvm/test
parentee0627fd1b9f89d6320b186f038bf14fbf6e8468 (diff)
downloadbcm5719-llvm-395cc09444b114bfb0f860bcd5c3d0365e7ca18c.tar.gz
bcm5719-llvm-395cc09444b114bfb0f860bcd5c3d0365e7ca18c.zip
More fixes to get good error messages for bad archives.
Fixed the last incorrect uses of llvm_unreachable() in the code which were actually just cases of errors in the input Archives. llvm-svn: 277540
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/tools/llvm-objdump/Inputs/libbogus11.a10
-rw-r--r--llvm/test/tools/llvm-objdump/Inputs/libbogus12.a10
-rw-r--r--llvm/test/tools/llvm-objdump/Inputs/libbogus13.a10
-rw-r--r--llvm/test/tools/llvm-objdump/Inputs/libbogus14.a10
-rw-r--r--llvm/test/tools/llvm-objdump/malformed-archives.test28
5 files changed, 68 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objdump/Inputs/libbogus11.a b/llvm/test/tools/llvm-objdump/Inputs/libbogus11.a
new file mode 100644
index 00000000000..99a709da8d6
--- /dev/null
+++ b/llvm/test/tools/llvm-objdump/Inputs/libbogus11.a
@@ -0,0 +1,10 @@
+!<arch>
+hello.c 1444941273 ~97& 0 100644 102 `
+#include <stdio.h>
+#include <stdlib.h>
+int
+main()
+{
+ printf("Hello World\n");
+ return EXIT_SUCCESS;
+}
diff --git a/llvm/test/tools/llvm-objdump/Inputs/libbogus12.a b/llvm/test/tools/llvm-objdump/Inputs/libbogus12.a
new file mode 100644
index 00000000000..fab3cfc4069
--- /dev/null
+++ b/llvm/test/tools/llvm-objdump/Inputs/libbogus12.a
@@ -0,0 +1,10 @@
+!<arch>
+hello.c 1444941273 124 #55! 100644 102 `
+#include <stdio.h>
+#include <stdlib.h>
+int
+main()
+{
+ printf("Hello World\n");
+ return EXIT_SUCCESS;
+}
diff --git a/llvm/test/tools/llvm-objdump/Inputs/libbogus13.a b/llvm/test/tools/llvm-objdump/Inputs/libbogus13.a
new file mode 100644
index 00000000000..f6f80829186
--- /dev/null
+++ b/llvm/test/tools/llvm-objdump/Inputs/libbogus13.a
@@ -0,0 +1,10 @@
+!<arch>
+hello.c 1444941273 124 0 Feed 102 `
+#include <stdio.h>
+#include <stdlib.h>
+int
+main()
+{
+ printf("Hello World\n");
+ return EXIT_SUCCESS;
+}
diff --git a/llvm/test/tools/llvm-objdump/Inputs/libbogus14.a b/llvm/test/tools/llvm-objdump/Inputs/libbogus14.a
new file mode 100644
index 00000000000..003cc986fc9
--- /dev/null
+++ b/llvm/test/tools/llvm-objdump/Inputs/libbogus14.a
@@ -0,0 +1,10 @@
+!<arch>
+hello.c 1foobar273 124 0 100644 102 `
+#include <stdio.h>
+#include <stdlib.h>
+int
+main()
+{
+ printf("Hello World\n");
+ return EXIT_SUCCESS;
+}
diff --git a/llvm/test/tools/llvm-objdump/malformed-archives.test b/llvm/test/tools/llvm-objdump/malformed-archives.test
index a9733d5939d..b8ba48d838e 100644
--- a/llvm/test/tools/llvm-objdump/malformed-archives.test
+++ b/llvm/test/tools/llvm-objdump/malformed-archives.test
@@ -58,3 +58,31 @@
# RUN: 2>&1 | FileCheck -check-prefix=bogus10 %s
# bogus10: libbogus10.a(???) truncated or malformed archive (long name offset 507 past the end of the string table for archive member header at offset 94)
+
+# RUN: not llvm-objdump -macho -archive-headers \
+# RUN: %p/Inputs/libbogus11.a \
+# RUN: 2>&1 | FileCheck -check-prefix=bogus11 %s
+
+# bogus11: libbogus11.a(hello.c) truncated or malformed archive (characters in UID field in archive header are not all decimal numbers: '~97&' for the archive member header at offset 8)
+
+# RUN: not llvm-objdump -macho -archive-headers \
+# RUN: %p/Inputs/libbogus12.a \
+# RUN: 2>&1 | FileCheck -check-prefix=bogus12 %s
+
+# bogus12: libbogus12.a(hello.c) truncated or malformed archive (characters in GID field in archive header are not all decimal numbers: '#55!' for the archive member header at offset 8)
+
+# RUN: not llvm-objdump -macho -archive-headers \
+# RUN: %p/Inputs/libbogus13.a \
+# RUN: 2>&1 | FileCheck -check-prefix=bogus13 %s
+
+# bogus13: libbogus13.a(hello.c) truncated or malformed archive (characters in AccessMode field in archive header are not all decimal numbers: 'Feed' for the archive member header at offset 8)
+
+# RUN: llvm-objdump -macho -archive-headers %p/Inputs/libbogus14.a \
+# RUN: 2>&1 | FileCheck -check-prefix=bogus14 %s
+
+# bogus14: -rw-r--r--124/0 102 (date: "1foobar273" contains non-decimal chars) hello.c
+
+# RUN: not llvm-ar tv %p/Inputs/libbogus14.a \
+# RUN: 2>&1 | FileCheck -check-prefix=bogus14a %s
+
+# bogus14a: truncated or malformed archive (characters in LastModified field in archive header are not all decimal numbers: '1foobar273' for the archive member header at offset 8)
OpenPOWER on IntegriCloud