blob: 824e2492c04e2563245f704ceb690403af24f85a [file] [log] [blame]
Dan Gohman3c7d3082009-09-11 18:01:28 +00001; RUN: opt < %s -scalarrepl -instcombine -S | not grep alloca
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
Chris Lattner4b9c8b72009-01-31 02:28:54 +00003; Test that an array is not incorrectly deconstructed.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Chris Lattner4b9c8b72009-01-31 02:28:54 +00005define i32 @test() nounwind {
Tanya Lattner307f46e2008-03-18 04:14:37 +00006 %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=1]
7 %Y = getelementptr [4 x i32]* %X, i64 0, i64 0 ; <i32*> [#uses=1]
8 ; Must preserve arrayness!
9 %Z = getelementptr i32* %Y, i64 1 ; <i32*> [#uses=1]
10 %A = load i32* %Z ; <i32> [#uses=1]
11 ret i32 %A
Dan Gohmanf17a25c2007-07-18 16:29:46 +000012}