summaryrefslogtreecommitdiff
path: root/test/CodeGen/Thumb
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2016-06-14 13:33:07 +0000
committerJames Molloy <james.molloy@arm.com>2016-06-14 13:33:07 +0000
commita523293cd962aa6eaf71e62b9a945aec81d05595 (patch)
tree4ff085ed14e5565843b59431a87d61253497bc23 /test/CodeGen/Thumb
parent49fa89507c3a54c8e0934f46a874d497c3b0c526 (diff)
[Thumb] Fix off-by-one error in r272007
We can only generate immediates up to #510 with a MOV+ADD, not #511, because there's no such instruction as add #256. Found by Oliver Stannard and csmith! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb')
-rw-r--r--test/CodeGen/Thumb/constants.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb/constants.ll b/test/CodeGen/Thumb/constants.ll
index 34c08139602..b1145d7b1d8 100644
--- a/test/CodeGen/Thumb/constants.ll
+++ b/test/CodeGen/Thumb/constants.ll
@@ -9,3 +9,11 @@
define i32 @mov_and_add() {
ret i32 267
}
+
+; CHECK-T1-LABEL: @mov_and_add2
+; CHECK-T2-LABEL: @mov_and_add2
+; CHECK-T1: ldr r0,
+; CHECK-T2: movw r0, #511
+define i32 @mov_and_add2() {
+ ret i32 511
+}