2003-09-12 23:44:01 +08:00
|
|
|
; Scalar replacement was incorrectly promoting this alloca!!
|
|
|
|
;
|
2008-03-18 12:14:37 +08:00
|
|
|
; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \
|
2008-06-11 00:04:47 +08:00
|
|
|
; RUN: sed {s/;.*//g} | grep {\\\[}
|
2003-09-12 23:44:01 +08:00
|
|
|
|
2008-03-18 12:14:37 +08:00
|
|
|
define i8* @test() {
|
|
|
|
%A = alloca [30 x i8] ; <[30 x i8]*> [#uses=1]
|
|
|
|
%B = getelementptr [30 x i8]* %A, i64 0, i64 0 ; <i8*> [#uses=2]
|
|
|
|
%C = getelementptr i8* %B, i64 1 ; <i8*> [#uses=1]
|
|
|
|
store i8 0, i8* %B
|
|
|
|
ret i8* %C
|
2003-09-12 23:44:01 +08:00
|
|
|
}
|
2008-03-18 12:14:37 +08:00
|
|
|
|