[PATCH] D14651: [AArch64] ldr= pseudo-instruction silently ignored if register invalid

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 02:27:56 PST 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL253193: [AArch64] ldr= pseudo-instruction silently ignored if register invalid (authored by olista01).

Changed prior to commit:
  http://reviews.llvm.org/D14651?vs=40141&id=40260#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D14651

Files:
  llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  llvm/trunk/test/MC/AArch64/ldr-pseudo-diagnostics.s

Index: llvm/trunk/test/MC/AArch64/ldr-pseudo-diagnostics.s
===================================================================
--- llvm/trunk/test/MC/AArch64/ldr-pseudo-diagnostics.s
+++ llvm/trunk/test/MC/AArch64/ldr-pseudo-diagnostics.s
@@ -12,3 +12,21 @@
 // CHECK-ERROR: error: Immediate too large for register
 // CHECK-ERROR:  ldr w0, =-0x80000001
 // CHECK-ERROR:          ^
+
+f3:
+  ldr foo, =1
+// CHECK-ERROR: error: Only valid when first operand is register
+// CHECK-ERROR:   ldr foo, =1
+// CHECK-ERROR:            ^
+
+f4:
+  add r0, r0, =1
+// CHECK-ERROR: error: unexpected token in operand
+// CHECK-ERROR:   add r0, r0, =1
+// CHECK-ERROR:               ^
+
+f5:
+  ldr x0, =())
+// CHECK-ERROR: error: unknown token in expression
+// CHECK-ERROR:   ldr x0, =())
+// CHECK-ERROR:             ^
Index: llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -3178,7 +3178,7 @@
 
     if (Operands.size() < 2 ||
         !static_cast<AArch64Operand &>(*Operands[1]).isReg())
-      return true;
+      return Error(Loc, "Only valid when first operand is register");
 
     bool IsXReg =
         AArch64MCRegisterClasses[AArch64::GPR64allRegClassID].contains(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14651.40260.patch
Type: text/x-patch
Size: 1383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151116/2162aae5/attachment.bin>


More information about the llvm-commits mailing list