[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!
llvm-svn: 272665
diff --git a/llvm/test/CodeGen/Thumb/constants.ll b/llvm/test/CodeGen/Thumb/constants.ll
index 34c0813..b1145d7 100644
--- a/llvm/test/CodeGen/Thumb/constants.ll
+++ b/llvm/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
+}