From 78762a19e4c57d30a05b27c8d5bbd98abb56c284 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 4 Oct 2017 09:24:54 +0000 Subject: [PATCH] [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 --- lib/Target/ARM/ARMInstrInfo.td | 1 + test/MC/ARM/diagnostics.s | 4 ++-- test/MC/ARM/thumb2-diagnostics.s | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td index af065441ec7..c031f6ff7ac 100644 --- a/lib/Target/ARM/ARMInstrInfo.td +++ b/lib/Target/ARM/ARMInstrInfo.td @@ -822,6 +822,7 @@ def imm0_65535_neg : Operand, ImmLeaf { diff --git a/test/MC/ARM/diagnostics.s b/test/MC/ARM/diagnostics.s index 0f697e6b367..ca080cc947b 100644 --- a/test/MC/ARM/diagnostics.s +++ b/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: ^ diff --git a/test/MC/ARM/thumb2-diagnostics.s b/test/MC/ARM/thumb2-diagnostics.s index 32a00a75255..67ce2423569 100644 --- a/test/MC/ARM/thumb2-diagnostics.s +++ b/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 -- 2.50.1