summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2014-03-25 00:05:50 +0000
committerKevin Enderby <enderby@apple.com>2014-03-25 00:05:50 +0000
commit4a88cd08da9318d5d29cad4f9807ec395b341f68 (patch)
treee93ef88009ec48906f9371ce03e0506f73f82522 /test
parent66124f9e8949e683d39592d2cfe1f347a2510943 (diff)
downloadllvm-4a88cd08da9318d5d29cad4f9807ec395b341f68.tar.gz
llvm-4a88cd08da9318d5d29cad4f9807ec395b341f68.tar.bz2
llvm-4a88cd08da9318d5d29cad4f9807ec395b341f68.tar.xz
Fix crashes when assembler directives are used that are not
for Mach-O object files by generating an error instead. rdar://16335232 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204687 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/MachO/ARM/bad-darwin-directives.s24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/MC/MachO/ARM/bad-darwin-directives.s b/test/MC/MachO/ARM/bad-darwin-directives.s
new file mode 100644
index 0000000000..0499e406df
--- /dev/null
+++ b/test/MC/MachO/ARM/bad-darwin-directives.s
@@ -0,0 +1,24 @@
+@ RUN: not llvm-mc -n -triple armv7-apple-darwin10 %s -filetype=obj -o - 2> %t.err > %t
+@ RUN: FileCheck --check-prefix=CHECK-ERROR < %t.err %s
+@ rdar://16335232
+
+.eabi_attribute 8, 1
+@ CHECK-ERROR: error: .eabi_attribute directive not valid for Mach-O
+
+.cpu
+@ CHECK-ERROR: error: .cpu directive not valid for Mach-O
+
+.fpu neon
+@ CHECK-ERROR: error: .fpu directive not valid for Mach-O
+
+.arch armv7
+@ CHECK-ERROR: error: .arch directive not valid for Mach-O
+
+.fnstart
+@ CHECK-ERROR: error: .fnstart directive not valid for Mach-O
+
+.tlsdescseq
+@ CHECK-ERROR: error: .tlsdescseq directive not valid for Mach-O
+
+.object_arch armv7
+@ CHECK-ERROR: error: .object_arch directive not valid for Mach-O