llvm.org GIT mirror llvm / 78762a1
[ARM] Add diag string for movw/movt immediates in assembly This adds diagnostics for invalid immediate operands to the MOVW and MOVT instructions (ARM and Thumb). Differential revision: https://reviews.llvm.org/D31879 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314888 91177308-0d34-0410-b5e6-96231b3b80d8 Oliver Stannard 2 years ago
3 changed file(s) with 7 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
821821 def Imm0_65535ExprAsmOperand: AsmOperandClass {
822822 let Name = "Imm0_65535Expr";
823823 let RenderMethod = "addImmOperands";
824 let DiagnosticString = "operand must be an immediate in the range [0,0xffff] or a relocatable expression";
824825 }
825826
826827 def imm0_65535_expr : Operand {
174174
175175 @ Out of range immediate for MOV
176176 movw r9, 0x10000
177 @ CHECK-ERRORS: error: invalid operand for instruction
177 @ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
178178 @ CHECK-ERRORS: movw r9, 0x10000
179179 @ CHECK-ERRORS: ^
180180
186186
187187 @ Out of range immediate for MOVT
188188 movt r9, 0x10000
189 @ CHECK-ERRORS: error: invalid operand for instruction
189 @ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
190190 @ CHECK-ERRORS: movt r9, 0x10000
191191 @ CHECK-ERRORS: ^
192192
7979 foo2:
8080 movw r0, foo2
8181 movt r0, foo2
82 movt r0, #0x10000
83 movt r0, #0x10000
8284 @ CHECK-ERRORS: error: immediate expression for mov requires :lower16: or :upper16
8385 @ CHECK-ERRORS: ^
8486 @ CHECK-ERRORS: immediate expression for mov requires :lower16: or :upper16
8587 @ CHECK-ERRORS: ^
88 @ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
89 @ CHECK-ERRORS: error: operand must be an immediate in the range [0,0xffff] or a relocatable expression
8690
8791 and sp, r1, #80008000
8892 and pc, r1, #80008000