]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Analysis/LoopDependenceAnalysis/local-array.ll
Update llvm to r84175.
[FreeBSD/FreeBSD.git] / test / Analysis / LoopDependenceAnalysis / local-array.ll
1 ; RUN: llvm-as < %s | opt -disable-output -analyze -lda > %t
2 ; RUN: grep {instructions: 2} %t | count 1
3 ; RUN: grep {0,1: dependent} %t | count 1
4
5 ; x[5] = x[6] // with x being an array on the stack
6
7 define void @foo(...) nounwind {
8 entry:
9   %xptr = alloca [256 x i32], align 4
10   %x.ld.addr = getelementptr [256 x i32]* %xptr, i64 0, i64 6
11   %x.st.addr = getelementptr [256 x i32]* %xptr, i64 0, i64 5
12   br label %for.body
13
14 for.body:
15   %i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
16   %x = load i32* %x.ld.addr
17   store i32 %x, i32* %x.st.addr
18   %i.next = add i64 %i, 1
19   %exitcond = icmp eq i64 %i.next, 256
20   br i1 %exitcond, label %for.end, label %for.body
21
22 for.end:
23   ret void
24 }