[llvm] r297739 - [ARM] Diagnose ARM MOVT without :lower16: or :upper16: expression

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 06:50:11 PDT 2017


Author: olista01
Date: Tue Mar 14 08:50:10 2017
New Revision: 297739

URL: http://llvm.org/viewvc/llvm-project?rev=297739&view=rev
Log:
[ARM] Diagnose ARM MOVT without :lower16: or :upper16: expression

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


Modified:
    llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
    llvm/trunk/test/MC/ARM/diagnostics.s

Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=297739&r1=297738&r2=297739&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Tue Mar 14 08:50:10 2017
@@ -6682,6 +6682,7 @@ bool ARMAsmParser::validateInstruction(M
     break;
   }
   case ARM::MOVi16:
+  case ARM::MOVTi16:
   case ARM::t2MOVi16:
   case ARM::t2MOVTi16:
     {

Modified: llvm/trunk/test/MC/ARM/diagnostics.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/diagnostics.s?rev=297739&r1=297738&r2=297739&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/diagnostics.s (original)
+++ llvm/trunk/test/MC/ARM/diagnostics.s Tue Mar 14 08:50:10 2017
@@ -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]!




More information about the llvm-commits mailing list