[PATCH] D31879: [ARM] Add diag string for movw/movt immediates in assembly

Oliver Stannard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 02:26:48 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL314888: [ARM] Add diag string for movw/movt immediates in assembly (authored by olista01).

Changed prior to commit:
  https://reviews.llvm.org/D31879?vs=94659&id=117641#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D31879

Files:
  llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
  llvm/trunk/test/MC/ARM/diagnostics.s
  llvm/trunk/test/MC/ARM/thumb2-diagnostics.s


Index: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
@@ -822,6 +822,7 @@
 def Imm0_65535ExprAsmOperand: AsmOperandClass {
   let Name = "Imm0_65535Expr";
   let RenderMethod = "addImmOperands";
+  let DiagnosticString = "operand must be an immediate in the range [0,0xffff] or a relocatable expression";
 }
 
 def imm0_65535_expr : Operand<i32> {
Index: llvm/trunk/test/MC/ARM/thumb2-diagnostics.s
===================================================================
--- llvm/trunk/test/MC/ARM/thumb2-diagnostics.s
+++ llvm/trunk/test/MC/ARM/thumb2-diagnostics.s
@@ -80,10 +80,14 @@
 foo2:
         movw r0, foo2
         movt r0, foo2
+        movt r0, #0x10000
+        movt r0, #0x10000
 @ CHECK-ERRORS: error: immediate expression for mov requires :lower16: or :upper16
 @ CHECK-ERRORS:                  ^
 @ CHECK-ERRORS: immediate expression for mov requires :lower16: or :upper16
 @ CHECK-ERRORS:                  ^
+@ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
+@ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
 
         and sp, r1, #80008000
         and pc, r1, #80008000
Index: llvm/trunk/test/MC/ARM/diagnostics.s
===================================================================
--- llvm/trunk/test/MC/ARM/diagnostics.s
+++ llvm/trunk/test/MC/ARM/diagnostics.s
@@ -175,7 +175,7 @@
 
         @ Out of range immediate for MOV
         movw r9, 0x10000
-@ CHECK-ERRORS: error: invalid operand for instruction
+@ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
 @ CHECK-ERRORS:        movw r9, 0x10000
 @ CHECK-ERRORS:                 ^
 
@@ -187,7 +187,7 @@
 
         @ Out of range immediate for MOVT
         movt r9, 0x10000
-@ CHECK-ERRORS: error: invalid operand for instruction
+@ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
 @ CHECK-ERRORS:        movt r9, 0x10000
 @ CHECK-ERRORS:                 ^
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31879.117641.patch
Type: text/x-patch
Size: 2205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171004/d30c3fd1/attachment.bin>


More information about the llvm-commits mailing list