summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Thumb/and_neg.ll
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2016-06-29 17:34:31 +0000
committerNico Weber <nicolasweber@gmx.de>2016-06-29 17:34:31 +0000
commit0a480b2c050d06bcf94a837e19217d577e69e4b6 (patch)
tree44eab9a064dcb0a391adb1537e4093185c504896 /llvm/test/CodeGen/Thumb/and_neg.ll
parent12fdf60b75f847666193f14db3d05bab6194ec26 (diff)
downloadbcm5719-llvm-0a480b2c050d06bcf94a837e19217d577e69e4b6.tar.gz
bcm5719-llvm-0a480b2c050d06bcf94a837e19217d577e69e4b6.zip
Add a regression test for PR28348.
llvm-svn: 274142
Diffstat (limited to 'llvm/test/CodeGen/Thumb/and_neg.ll')
-rw-r--r--llvm/test/CodeGen/Thumb/and_neg.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Thumb/and_neg.ll b/llvm/test/CodeGen/Thumb/and_neg.ll
new file mode 100644
index 00000000000..88217c7cb20
--- /dev/null
+++ b/llvm/test/CodeGen/Thumb/and_neg.ll
@@ -0,0 +1,20 @@
+; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi -verify-machineinstrs
+; Just shouldn't crash, PR28348
+
+%C = type { i8* }
+
+define void @repro(%C* %this, i32 %a) {
+ %a_align1 = and i32 %a, -4096
+ %a_and = and i32 %a, 4095
+ %a_align2 = or i32 %a_and, 4096
+
+ call void @use(i32 %a_align1)
+
+ %C_field = getelementptr inbounds %C, %C* %this, i32 0, i32 0
+ %addptr = getelementptr inbounds i8, i8* null, i32 %a_align2
+ store i8* %addptr, i8** %C_field, align 4
+
+ ret void
+}
+
+declare void @use(i32)
OpenPOWER on IntegriCloud