1; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
2
3define i32 @test() {
4; CHECK: ret i32 0
5        %A = alloca i32         ; <i32*> [#uses=3]
6        call void @foo( i32* %A )
7        %X = load i32, i32* %A               ; <i32> [#uses=1]
8        tail call void @bar( )
9        %Y = load i32, i32* %A               ; <i32> [#uses=1]
10        %Z = sub i32 %X, %Y             ; <i32> [#uses=1]
11        ret i32 %Z
12}
13
14declare void @foo(i32*)
15
16declare void @bar()
17