From f4f930c7955fa1c58197dd89d4c6cbb7a9ed45ba Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 22 May 2014 02:18:10 +0000 Subject: MC: formalise some assertions into proper errors Now that clang can be used as an assembler via the IAS, invalid assembler inputs would cause the assertions to trigger. Although we cannot recover from the errors here, nor provide caret diagnostics, attempt to handle them slightly more gracefully by reporting a fatal error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209387 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/COFF/invalid-def.s | 6 ++++++ test/MC/COFF/invalid-endef.s | 5 +++++ test/MC/COFF/invalid-scl-range.s | 7 +++++++ test/MC/COFF/invalid-scl.s | 5 +++++ test/MC/COFF/invalid-type-range.s | 7 +++++++ test/MC/COFF/invalid-type.s | 5 +++++ 6 files changed, 35 insertions(+) create mode 100644 test/MC/COFF/invalid-def.s create mode 100644 test/MC/COFF/invalid-endef.s create mode 100644 test/MC/COFF/invalid-scl-range.s create mode 100644 test/MC/COFF/invalid-scl.s create mode 100644 test/MC/COFF/invalid-type-range.s create mode 100644 test/MC/COFF/invalid-type.s (limited to 'test/MC/COFF') diff --git a/test/MC/COFF/invalid-def.s b/test/MC/COFF/invalid-def.s new file mode 100644 index 0000000000..bfa1a54cbd --- /dev/null +++ b/test/MC/COFF/invalid-def.s @@ -0,0 +1,6 @@ +# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s +# REQUIRES: asserts + + .def first + .def second + diff --git a/test/MC/COFF/invalid-endef.s b/test/MC/COFF/invalid-endef.s new file mode 100644 index 0000000000..543685a66c --- /dev/null +++ b/test/MC/COFF/invalid-endef.s @@ -0,0 +1,5 @@ +# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s +# REQUIRES: asserts + + .endef + diff --git a/test/MC/COFF/invalid-scl-range.s b/test/MC/COFF/invalid-scl-range.s new file mode 100644 index 0000000000..ec0c2bb192 --- /dev/null +++ b/test/MC/COFF/invalid-scl-range.s @@ -0,0 +1,7 @@ +# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s +# REQUIRES: asserts + + .def storage_class_range + .scl 1337 + .endef + diff --git a/test/MC/COFF/invalid-scl.s b/test/MC/COFF/invalid-scl.s new file mode 100644 index 0000000000..0d62497e96 --- /dev/null +++ b/test/MC/COFF/invalid-scl.s @@ -0,0 +1,5 @@ +# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s +# REQUIRES: asserts + + .scl 1337 + diff --git a/test/MC/COFF/invalid-type-range.s b/test/MC/COFF/invalid-type-range.s new file mode 100644 index 0000000000..9397cc50c3 --- /dev/null +++ b/test/MC/COFF/invalid-type-range.s @@ -0,0 +1,7 @@ +# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s +# REQUIRES: asserts + + .def invalid_type_range + .type 65536 + .endef + diff --git a/test/MC/COFF/invalid-type.s b/test/MC/COFF/invalid-type.s new file mode 100644 index 0000000000..a5c61f4aba --- /dev/null +++ b/test/MC/COFF/invalid-type.s @@ -0,0 +1,5 @@ +# RUN: not llvm-mc -triple i686-windows -filetype obj -o /dev/null %s +# REQUIRES: asserts + + .type 65536 + -- cgit v1.2.3