2003-09-20 11:08:21 +08:00
|
|
|
; In this test, a local alloca cannot alias an incoming argument.
|
|
|
|
|
2012-04-24 17:15:38 +08:00
|
|
|
; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
|
|
|
|
|
|
|
|
; CHECK: define i32 @test
|
|
|
|
; CHECK-NEXT: ret i32 0
|
2003-09-20 11:08:21 +08:00
|
|
|
|
2008-02-14 14:56:27 +08:00
|
|
|
define i32 @test(i32* %P) {
|
|
|
|
%X = alloca i32
|
2015-02-28 05:17:42 +08:00
|
|
|
%V1 = load i32, i32* %P
|
2008-02-14 14:56:27 +08:00
|
|
|
store i32 0, i32* %X
|
2015-02-28 05:17:42 +08:00
|
|
|
%V2 = load i32, i32* %P
|
2008-02-14 14:56:27 +08:00
|
|
|
%Diff = sub i32 %V1, %V2
|
|
|
|
ret i32 %Diff
|
2003-09-20 11:08:21 +08:00
|
|
|
}
|