summaryrefslogtreecommitdiff
path: root/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll
blob: 54dc693e4a8d974dcbe624d3aba137e14d727cb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
; Scalar replacement was incorrectly promoting this alloca!!
;
; RUN: opt %s -scalarrepl | llvm-dis | \
; RUN:   sed {s/;.*//g} | grep {\\\[}

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
}