35 lines · plain
1; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s2 3declare ptr @captures(ptr %cap) nounwind readonly4 5; CHECK-LABEL: no6; CHECK: NoAlias: i32* %a, i32* %b7define void @no(ptr noalias %a, ptr %b) nounwind {8entry:9 store i32 1, ptr %a10 %cap = call ptr @captures(ptr %a) nounwind readonly11 %l = load i32, ptr %b12 ret void13}14 15; CHECK-LABEL: yes16; CHECK: MayAlias: i32* %c, i32* %d17define void @yes(ptr %c, ptr %d) nounwind {18entry:19 store i32 1, ptr %c 20 %cap = call ptr @captures(ptr %c) nounwind readonly21 %l = load i32, ptr %d22 ret void23}24 25; Result should be the same for byval instead of noalias.26; CHECK-LABEL: byval27; CHECK: NoAlias: i32* %a, i32* %b28define void @byval(ptr byval(i32) %a, ptr %b) nounwind {29entry:30 store i32 1, ptr %a31 %cap = call ptr @captures(ptr %a) nounwind readonly32 %l = load i32, ptr %b33 ret void34}35