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)
7 declare void @readonly_func(ptr nocapture) readonly
8 declare void @writeonly_func(ptr nocapture) writeonly
9 declare void @readnone_func(ptr nocapture) readnone
11 declare void @read_write(ptr writeonly nocapture, ptr readonly nocapture, ptr readnone nocapture)
15 define void @test(ptr noalias %p) {
18 call void @readonly_attr(ptr %p)
19 call void @readonly_func(ptr %p)
21 call void @writeonly_attr(ptr %p)
22 call void @writeonly_func(ptr %p)
24 call void @readnone_attr(ptr %p)
25 call void @readnone_func(ptr %p)
27 call void @read_write(ptr %p, ptr %p, ptr %p)
29 call void @func() ["deopt" (ptr %p)]
30 call void @writeonly_attr(ptr %p) ["deopt" (ptr %p)]
35 ; CHECK: Just Ref: Ptr: i8* %p <-> call void @readonly_attr(ptr %p)
36 ; CHECK: Just Ref: Ptr: i8* %p <-> call void @readonly_func(ptr %p)
37 ; CHECK: Just Mod: Ptr: i8* %p <-> call void @writeonly_attr(ptr %p)
38 ; CHECK: Just Mod: Ptr: i8* %p <-> call void @writeonly_func(ptr %p)
39 ; CHECK: NoModRef: Ptr: i8* %p <-> call void @readnone_attr(ptr %p)
40 ; CHECK: NoModRef: Ptr: i8* %p <-> call void @readnone_func(ptr %p)
41 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @read_write(ptr %p, ptr %p, ptr %p)
42 ; CHECK: Just Ref: Ptr: i8* %p <-> call void @func() [ "deopt"(ptr %p) ]
43 ; CHECK: Both ModRef: Ptr: i8* %p <-> call void @writeonly_attr(ptr %p) [ "deopt"(ptr %p) ]