1 ; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
3 declare void @readonly_attr(i8* readonly nocapture)
4 declare void @writeonly_attr(i8* writeonly nocapture)
5 declare void @readnone_attr(i8* readnone nocapture)
7 declare void @readonly_func(i8* nocapture) readonly
8 declare void @writeonly_func(i8* nocapture) writeonly
9 declare void @readnone_func(i8* nocapture) readnone
11 declare void @read_write(i8* writeonly nocapture, i8* readonly nocapture, i8* readnone nocapture)
15 define void @test(i8* noalias %p) {
17 call void @readonly_attr(i8* %p)
18 call void @readonly_func(i8* %p)
20 call void @writeonly_attr(i8* %p)
21 call void @writeonly_func(i8* %p)
23 call void @readnone_attr(i8* %p)
24 call void @readnone_func(i8* %p)
26 call void @read_write(i8* %p, i8* %p, i8* %p)
28 call void @func() ["deopt" (i8* %p)]
29 call void @writeonly_attr(i8* %p) ["deopt" (i8* %p)]
34 ; CHECK: Just Ref (MustAlias): Ptr: i8* %p <-> call void @readonly_attr(i8* %p)
35 ; CHECK: Just Ref: Ptr: i8* %p <-> call void @readonly_func(i8* %p)
36 ; CHECK: Just Mod (MustAlias): Ptr: i8* %p <-> call void @writeonly_attr(i8* %p)
37 ; CHECK: Just Mod: Ptr: i8* %p <-> call void @writeonly_func(i8* %p)
38 ; CHECK: NoModRef: Ptr: i8* %p <-> call void @readnone_attr(i8* %p)
39 ; CHECK: NoModRef: Ptr: i8* %p <-> call void @readnone_func(i8* %p)
40 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @read_write(i8* %p, i8* %p, i8* %p)
41 ; CHECK: Just Ref (MustAlias): Ptr: i8* %p <-> call void @func() [ "deopt"(i8* %p) ]
42 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @writeonly_attr(i8* %p) [ "deopt"(i8* %p) ]