1 ; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
3 declare void @readonly_attr(ptr readonly nocapture)
4 declare void @writeonly_attr(ptr writeonly nocapture)
5 declare void @readnone_attr(ptr readnone nocapture)
6 declare void @byval_attr(ptr byval(i32))
8 declare void @readonly_func(ptr nocapture) readonly
9 declare void @writeonly_func(ptr nocapture) writeonly
10 declare void @readnone_func(ptr nocapture) readnone
12 declare void @read_write(ptr writeonly nocapture, ptr readonly nocapture, ptr readnone nocapture)
16 define void @test(ptr noalias %p) {
19 call void @readonly_attr(ptr %p)
20 call void @readonly_func(ptr %p)
22 call void @writeonly_attr(ptr %p)
23 call void @writeonly_func(ptr %p)
25 call void @readnone_attr(ptr %p)
26 call void @readnone_func(ptr %p)
28 call void @byval_attr(ptr %p)
30 call void @read_write(ptr %p, ptr %p, ptr %p)
32 call void @func() ["deopt" (ptr %p)]
33 call void @writeonly_attr(ptr %p) ["deopt" (ptr %p)]
38 ; CHECK: Just Ref: Ptr: i8* %p <-> call void @readonly_attr(ptr %p)
39 ; CHECK: Just Ref: Ptr: i8* %p <-> call void @readonly_func(ptr %p)
40 ; CHECK: Just Mod: Ptr: i8* %p <-> call void @writeonly_attr(ptr %p)
41 ; CHECK: Just Mod: Ptr: i8* %p <-> call void @writeonly_func(ptr %p)
42 ; CHECK: NoModRef: Ptr: i8* %p <-> call void @readnone_attr(ptr %p)
43 ; CHECK: NoModRef: Ptr: i8* %p <-> call void @readnone_func(ptr %p)
44 ; CHECK: Just Ref: Ptr: i8* %p <-> call void @byval_attr(ptr %p)
45 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @read_write(ptr %p, ptr %p, ptr %p)
46 ; CHECK: Just Ref: Ptr: i8* %p <-> call void @func() [ "deopt"(ptr %p) ]
47 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @writeonly_attr(ptr %p) [ "deopt"(ptr %p) ]