[ARM] Diagnose ARM MOVT without :lower16: or :upper16: expression
authorOliver Stannard <oliver.stannard@arm.com>
Tue, 14 Mar 2017 13:50:10 +0000 (13:50 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Tue, 14 Mar 2017 13:50:10 +0000 (13:50 +0000)
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.

Differential revision: https://reviews.llvm.org/D30936

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297739 91177308-0d34-0410-b5e6-96231b3b80d8

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

index f20ee1b91ac136690c94857e394fc4229a12a21f..1a6f8e763e29f5592323d02893e180f4e8d1febd 100644 (file)
@@ -6682,6 +6682,7 @@ bool ARMAsmParser::validateInstruction(MCInst &Inst,
     break;
   }
   case ARM::MOVi16:
+  case ARM::MOVTi16:
   case ARM::t2MOVi16:
   case ARM::t2MOVTi16:
     {
index a1dd95f7d7fcc9f22a456439b033bf1f7e403720..549b13b7d4231365765f4da8715a58702b12d59a 100644 (file)
 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]!