[PATCH] D30936: [ARM] Diagnose ARM MOVT without :lower16: or :upper16: expression

Oliver Stannard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 06:38:02 PDT 2017


olista01 created this revision.
Herald added a subscriber: aemerson.

This instruction was missing from the list of opcodes that we check, so we were hitting an llvm_unreachable in ARMMCCodeEmitter.cpp for the ARM MOVT instruction, rather than the diagnostic that is emitted for the other MOVW/MOVT instructions.


Repository:
  rL LLVM

https://reviews.llvm.org/D30936

Files:
  lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  test/MC/ARM/diagnostics.s


Index: test/MC/ARM/diagnostics.s
===================================================================
--- test/MC/ARM/diagnostics.s
+++ test/MC/ARM/diagnostics.s
@@ -491,10 +491,13 @@
 foo2:
         mov r0, foo2
         movw r0, foo2
+        movt r0, foo2
 @ CHECK-ERRORS: error: immediate expression for mov requires :lower16: or :upper16
 @ CHECK-ERRORS:                 ^
 @ CHECK-ERRORS: error: immediate expression for mov requires :lower16: or :upper16
 @ CHECK-ERRORS:                  ^
+@ CHECK-ERRORS: error: immediate expression for mov requires :lower16: or :upper16
+@ CHECK-ERRORS:                  ^
 
         str r0, [r0, #4]!
         str r0, [r0, r1]!
Index: lib/Target/ARM/AsmParser/ARMAsmParser.cpp
===================================================================
--- lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -6682,6 +6682,7 @@
     break;
   }
   case ARM::MOVi16:
+  case ARM::MOVTi16:
   case ARM::t2MOVi16:
   case ARM::t2MOVTi16:
     {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30936.91706.patch
Type: text/x-patch
Size: 1018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170314/0bf275d5/attachment.bin>


More information about the llvm-commits mailing list