aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury de la Vieuville <amaury.dlv@gmail.com>2013-06-13 16:40:51 +0000
committerAmaury de la Vieuville <amaury.dlv@gmail.com>2013-06-13 16:40:51 +0000
commit1290ce00a372f10fa1667d3566477f86ede04c73 (patch)
treea597ba0d5db00639f31176c41023971f2b65410d
parent13f17ea6c091423819b4008067f9835c7688edb4 (diff)
downloadexternal_llvm-1290ce00a372f10fa1667d3566477f86ede04c73.zip
external_llvm-1290ce00a372f10fa1667d3566477f86ede04c73.tar.gz
external_llvm-1290ce00a372f10fa1667d3566477f86ede04c73.tar.bz2
ARM: fix t2am_imm8_offset operand printing for imm=#-0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183913 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp4
-rw-r--r--test/MC/ARM/basic-thumb2-instructions.s2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
index 7fef795..0b3d266 100644
--- a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
+++ b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
@@ -1148,7 +1148,9 @@ void ARMInstPrinter::printT2AddrModeImm8OffsetOperand(const MCInst *MI,
const MCOperand &MO1 = MI->getOperand(OpNum);
int32_t OffImm = (int32_t)MO1.getImm();
O << ", " << markup("<imm:");
- if (OffImm < 0)
+ if (OffImm == INT32_MIN)
+ O << "#-0";
+ else if (OffImm < 0)
O << "#-" << -OffImm;
else
O << "#" << OffImm;
diff --git a/test/MC/ARM/basic-thumb2-instructions.s b/test/MC/ARM/basic-thumb2-instructions.s
index 98eb7f2..978ec82 100644
--- a/test/MC/ARM/basic-thumb2-instructions.s
+++ b/test/MC/ARM/basic-thumb2-instructions.s
@@ -2616,6 +2616,7 @@ _func:
strb r9, [r2], #4
strb r3, [sp], #-4
strb r4, [r8, #-0]!
+ strb r1, [r0], #-0
@ CHECK: strb r5, [r5, #-4] @ encoding: [0x05,0xf8,0x04,0x5c]
@ CHECK: strb.w r5, [r6, #32] @ encoding: [0x86,0xf8,0x20,0x50]
@@ -2629,6 +2630,7 @@ _func:
@ CHECK: strb r9, [r2], #4 @ encoding: [0x02,0xf8,0x04,0x9b]
@ CHECK: strb r3, [sp], #-4 @ encoding: [0x0d,0xf8,0x04,0x39]
@ CHECK: strb r4, [r8, #-0]! @ encoding: [0x08,0xf8,0x00,0x4d]
+@ CHECK: strb r1, [r0], #-0 @ encoding: [0x00,0xf8,0x00,0x19]
@------------------------------------------------------------------------------