When removing a function from the function set and adding it to deferred, we
[llvm.git] / test / Transforms / ScalarRepl / 2003-09-12-IncorrectPromote.ll
blobeb1c945e34eb8e53707ae5f030480d4f9e6efe6f
1 ; Scalar replacement was incorrectly promoting this alloca!!
3 ; RUN: opt < %s -scalarrepl -S | \
4 ; RUN:   sed {s/;.*//g} | grep {\\\[}
6 define i8* @test() {
7         %A = alloca [30 x i8]           ; <[30 x i8]*> [#uses=1]
8         %B = getelementptr [30 x i8]* %A, i64 0, i64 0          ; <i8*> [#uses=2]
9         %C = getelementptr i8* %B, i64 1                ; <i8*> [#uses=1]
10         store i8 0, i8* %B
11         ret i8* %C