From e971131695ac41afd56e82facddccc2807aa9bbd Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 5 Sep 2010 17:20:46 +0000 Subject: fix PR8063, a crash in globalopt in the malloc analysis code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113109 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/GlobalOpt/crash.ll | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/Transforms/GlobalOpt') diff --git a/test/Transforms/GlobalOpt/crash.ll b/test/Transforms/GlobalOpt/crash.ll index 701472c059..bb1fc84f46 100644 --- a/test/Transforms/GlobalOpt/crash.ll +++ b/test/Transforms/GlobalOpt/crash.ll @@ -40,3 +40,18 @@ xx: } declare noalias i8* @malloc(i64) nounwind + + +; PR8063 +@permute_bitrev.bitrev = internal global i32* null, align 8 +define void @permute_bitrev() nounwind { +entry: + %tmp = load i32** @permute_bitrev.bitrev, align 8 + %conv = sext i32 0 to i64 + %mul = mul i64 %conv, 4 + %call = call i8* @malloc(i64 %mul) + %0 = bitcast i8* %call to i32* + store i32* %0, i32** @permute_bitrev.bitrev, align 8 + ret void +} + -- cgit v1.2.3