Skip to content

Commit

Permalink
[ARM] Diagnose ARM MOVT without :lower16: or :upper16: expression
Browse files Browse the repository at this point in the history
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

llvm-svn: 297739
  • Loading branch information
ostannard committed Mar 14, 2017
1 parent 283316b commit 6ee22c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Expand Up @@ -6682,6 +6682,7 @@ bool ARMAsmParser::validateInstruction(MCInst &Inst,
break;
}
case ARM::MOVi16:
case ARM::MOVTi16:
case ARM::t2MOVi16:
case ARM::t2MOVTi16:
{
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/MC/ARM/diagnostics.s
Expand Up @@ -491,9 +491,12 @@
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]!
Expand Down

0 comments on commit 6ee22c4

Please sign in to comment.