[llvm] r274142 - Add a regression test for PR28348.

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 10:34:31 PDT 2016


Author: nico
Date: Wed Jun 29 12:34:31 2016
New Revision: 274142

URL: http://llvm.org/viewvc/llvm-project?rev=274142&view=rev
Log:
Add a regression test for PR28348.

Added:
    llvm/trunk/test/CodeGen/Thumb/and_neg.ll

Added: llvm/trunk/test/CodeGen/Thumb/and_neg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/and_neg.ll?rev=274142&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb/and_neg.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb/and_neg.ll Wed Jun 29 12:34:31 2016
@@ -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)




More information about the llvm-commits mailing list