summaryrefslogtreecommitdiff
path: root/test/CodeGen/Thumb
diff options
context:
space:
mode:
authorArtyom Skrobov <Artyom.Skrobov@arm.com>2017-03-22 15:09:30 +0000
committerArtyom Skrobov <Artyom.Skrobov@arm.com>2017-03-22 15:09:30 +0000
commit677bddb49c66987005264c262e36c40438dbf82a (patch)
treefa69d5fa76a0ff5637d52b13cc6135b2b8f22a98 /test/CodeGen/Thumb
parent30582488b0d9d8b8e0e9efc0c1e27f3f76680689 (diff)
[ARM] t2_so_imm_neg had a subtle bug in the conversion, and could trigger UB by negating (int)-2147483648. By pure luck, none of the pre-existing tests triggered this; so I'm adding one.
Summary: Thanks to Vitaly Buka for helping catch this. Reviewers: rengolin, jmolloy, efriedma, vitalybuka Subscribers: llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D31242 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb')
-rw-r--r--test/CodeGen/Thumb/ispositive.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb/ispositive.ll b/test/CodeGen/Thumb/ispositive.ll
index 8d396878932..a9b2c139797 100644
--- a/test/CodeGen/Thumb/ispositive.ll
+++ b/test/CodeGen/Thumb/ispositive.ll
@@ -9,3 +9,12 @@ entry:
ret i32 %1
}
+define i32 @test2(i32 %X) {
+entry:
+; CHECK-LABEL: test2:
+; CHECK: lsls r1, r1, #31
+; CHECK-NEXT: adds
+ %tmp1 = sub i32 %X, 2147483648
+ ret i32 %tmp1
+}
+