llvm.org GIT mirror llvm / 4298365
new testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26514 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 14 years ago
1 changed file(s) with 31 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | opt -aa-eval -disable-output 2>&1 | grep '2 no alias respon'
1
2 ;; TEST that A[1][0] may alias A[0][i].
3
4 void %test(int %N) {
5 entry:
6 %X = alloca [3 x [3 x int]] ; <[3 x [3 x int]]*> [#uses=4]
7 %tmp.24 = setgt int %N, 0 ; [#uses=1]
8 br bool %tmp.24, label %no_exit, label %loopexit
9
10 no_exit: ; preds = %no_exit, %entry
11 %i.0.0 = phi int [ 0, %entry ], [ %inc, %no_exit ] ; [#uses=2]
12 %tmp.6 = getelementptr [3 x [3 x int]]* %X, int 0, int 0, int %i.0.0 ; [#uses=1]
13 store int 1, int* %tmp.6
14 %tmp.8 = getelementptr [3 x [3 x int]]* %X, int 0, int 0, int 0 ; [#uses=1]
15 %tmp.9 = load int* %tmp.8 ; [#uses=1]
16 %tmp.11 = getelementptr [3 x [3 x int]]* %X, int 0, int 1, int 0 ; [#uses=1]
17 %tmp.12 = load int* %tmp.11 ; [#uses=1]
18 %tmp.13 = add int %tmp.12, %tmp.9 ; [#uses=1]
19 %inc = add int %i.0.0, 1 ; [#uses=2]
20 %tmp.2 = setlt int %inc, %N ; [#uses=1]
21 br bool %tmp.2, label %no_exit, label %loopexit
22
23 loopexit: ; preds = %no_exit, %entry
24 %Y.0.1 = phi int [ 0, %entry ], [ %tmp.13, %no_exit ] ; [#uses=1]
25 %tmp.4 = getelementptr [3 x [3 x int]]* %X, int 0, int 0 ; <[3 x int]*> [#uses=1]
26 %tmp.15 = call int (...)* %foo( [3 x int]* %tmp.4, int %Y.0.1 ) ; [#uses=0]
27 ret void
28 }
29
30 declare int %foo(...)