New testcase, SROA with variable array index

llvm-svn: 17726
This commit is contained in:
Chris Lattner 2004-11-14 04:58:40 +00:00
parent e90176e171
commit 8076a5de30
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis
implementation
int %test(int %X) {
%Arr = alloca [2 x int]
%tmp.0 = getelementptr [2 x int]* %Arr, int 0, int 0
store int 1, int* %tmp.0
%tmp.1 = getelementptr [2 x int]* %Arr, int 0, int 1
store int 2, int* %tmp.1
;; This should turn into a select instruction.
%tmp.3 = getelementptr [2 x int]* %Arr, int 0, int %X
%tmp.4 = load int* %tmp.3
ret int %tmp.4
}