From 45b6d08da3901e8dd84bc2cfca658599801589e1 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 29 Jun 2016 17:34:31 +0000 Subject: [PATCH] Add a regression test for PR28348. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274142 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/Thumb/and_neg.ll | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/CodeGen/Thumb/and_neg.ll diff --git a/test/CodeGen/Thumb/and_neg.ll b/test/CodeGen/Thumb/and_neg.ll new file mode 100644 index 00000000000..88217c7cb20 --- /dev/null +++ b/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) -- 2.11.0