1 ; RUN: opt < %s -tbaa -basicaa -gvn -S | FileCheck %s
3 ; Test that basic alias queries work.
7 define i8 @test0_yes(i8* %a, i8* %b) nounwind {
8 %x = load i8, i8* %a, !tbaa !1
9 store i8 0, i8* %b, !tbaa !2
10 %y = load i8, i8* %a, !tbaa !1
16 ; CHECK: add i8 %x, %y
17 define i8 @test0_no(i8* %a, i8* %b) nounwind {
18 %x = load i8, i8* %a, !tbaa !3
19 store i8 0, i8* %b, !tbaa !4
20 %y = load i8, i8* %a, !tbaa !3
25 ; Test that basic invariant-memory queries work.
28 ; CHECK: add i8 %x, %x
29 define i8 @test1_yes(i8* %a, i8* %b) nounwind {
30 %x = load i8, i8* %a, !tbaa !5
32 %y = load i8, i8* %a, !tbaa !5
38 ; CHECK: add i8 %x, %y
39 define i8 @test1_no(i8* %a, i8* %b) nounwind {
40 %x = load i8, i8* %a, !tbaa !6
42 %y = load i8, i8* %a, !tbaa !6
51 ; Some other non-aliasing type.
56 ; Some type in a different type system.
57 !4 = !{!10, !10, i64 0}
60 !5 = !{!11, !11, i64 0, i1 1}
61 ; Not invariant memory.
62 !6 = !{!11, !11, i64 0, i1 0}
66 !10 = !{ !"bar", !12 }