xref: /llvm-project/llvm/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll (revision 05ff7606c9d47135ecf5b69e25b1327634f6fa27)
1; In this test, a local alloca cannot alias an incoming argument.
2
3; RUN: opt < %s -aa-pipeline=basic-aa -passes=gvn,instcombine -S | FileCheck %s
4
5; CHECK:      define i32 @test
6; CHECK-NEXT: ret i32 0
7
8define i32 @test(ptr %P) {
9	%X = alloca i32
10	%V1 = load i32, ptr %P
11	store i32 0, ptr %X
12	%V2 = load i32, ptr %P
13	%Diff = sub i32 %V1, %V2
14	ret i32 %Diff
15}
16