From a523293cd962aa6eaf71e62b9a945aec81d05595 Mon Sep 17 00:00:00 2001 From: James Molloy Date: Tue, 14 Jun 2016 13:33:07 +0000 Subject: [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 --- test/CodeGen/Thumb/constants.ll | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/CodeGen/Thumb') 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 +} -- cgit v1.2.3