[opaque pointer type] Avoid using pointee types to retrieve InlineAsm's function...
[oota-llvm.git] / test / Analysis / CFLAliasAnalysis / constant-over-index.ll
1 ; RUN: opt < %s -cfl-aa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s
2
3 ; CFL AA currently returns PartialAlias, BasicAA returns MayAlias, both seem
4 ; acceptable (although we might decide that we don't want PartialAlias, and if
5 ; so, we should update this test case accordingly).
6 ; CHECK: {{PartialAlias|MayAlias}}: double* %p.0.i.0, double* %p3
7
8 ; %p3 is equal to %p.0.i.0 on the second iteration of the loop,
9 ; so MayAlias is needed.
10
11 define void @foo([3 x [3 x double]]* noalias %p) {
12 entry:
13   %p3 = getelementptr [3 x [3 x double]], [3 x [3 x double]]* %p, i64 0, i64 0, i64 3
14   br label %loop
15
16 loop:
17   %i = phi i64 [ 0, %entry ], [ %i.next, %loop ]
18
19   %p.0.i.0 = getelementptr [3 x [3 x double]], [3 x [3 x double]]* %p, i64 0, i64 %i, i64 0
20
21   store volatile double 0.0, double* %p3
22   store volatile double 0.1, double* %p.0.i.0
23
24   %i.next = add i64 %i, 1
25   %cmp = icmp slt i64 %i.next, 3
26   br i1 %cmp, label %loop, label %exit
27
28 exit:
29   ret void
30 }