1; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s 2 3declare void @readonly_attr(i8* readonly nocapture) 4declare void @writeonly_attr(i8* writeonly nocapture) 5declare void @readnone_attr(i8* readnone nocapture) 6 7declare void @readonly_func(i8* nocapture) readonly 8declare void @writeonly_func(i8* nocapture) writeonly 9declare void @readnone_func(i8* nocapture) readnone 10 11declare void @read_write(i8* writeonly nocapture, i8* readonly nocapture, i8* readnone nocapture) 12 13declare void @func() 14 15define void @test(i8* noalias %p) { 16entry: 17 call void @readonly_attr(i8* %p) 18 call void @readonly_func(i8* %p) 19 20 call void @writeonly_attr(i8* %p) 21 call void @writeonly_func(i8* %p) 22 23 call void @readnone_attr(i8* %p) 24 call void @readnone_func(i8* %p) 25 26 call void @read_write(i8* %p, i8* %p, i8* %p) 27 28 call void @func() ["deopt" (i8* %p)] 29 call void @writeonly_attr(i8* %p) ["deopt" (i8* %p)] 30 31 ret void 32} 33 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) ] 43