1 ; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 %struct = type { i32, i32, i32 }
7 ; CHECK-LABEL: test_simple
9 ; CHECK-DAG: MustAlias: %struct* %st, %struct* %sta
11 ; CHECK-DAG: MayAlias: %struct* %st, i32* %x
12 ; CHECK-DAG: MayAlias: %struct* %st, i32* %y
13 ; CHECK-DAG: MayAlias: %struct* %st, i32* %z
15 ; CHECK-DAG: NoAlias: i32* %x, i32* %y
16 ; CHECK-DAG: NoAlias: i32* %x, i32* %z
17 ; CHECK-DAG: NoAlias: i32* %y, i32* %z
19 ; CHECK-DAG: MayAlias: %struct* %st, %struct* %y
20 ; CHECK-DAG: MayAlias: i32* %x, %struct* %y
21 ; CHECK-DAG: MayAlias: i32* %x, i80* %y
23 ; CHECK-DAG: MayAlias: %struct* %st, i64* %ya
24 ; CHECK-DAG: MayAlias: i64* %ya, i32* %z
25 ; CHECK-DAG: NoAlias: i32* %x, i64* %ya
27 ; CHECK-DAG: MustAlias: %struct* %y, i32* %y
28 ; CHECK-DAG: MustAlias: i32* %y, i64* %ya
29 ; CHECK-DAG: MustAlias: i80* %y, i32* %y
31 define void @test_simple(ptr %st, i64 %i, i64 %j, i64 %k) {
32 %x = getelementptr inbounds %struct, ptr %st, i64 %i, i32 0
33 %y = getelementptr inbounds %struct, ptr %st, i64 %j, i32 1
34 %sta = call ptr @func2(ptr %st)
35 %z = getelementptr inbounds %struct, ptr %sta, i64 %k, i32 2
36 %ya = call ptr @func1(ptr %y)
38 load %struct, ptr %sta
48 declare ptr @func1(ptr returned) nounwind
49 declare ptr @func2(ptr returned) nounwind