Make BasicAliasAnalysis a normal AliasAnalysis implementation which
[oota-llvm.git] / test / Transforms / Sink / basic.ll
1 ; RUN: opt < %s -basicaa -sink -S | FileCheck %s
2
3 @A = external global i32
4 @B = external global i32
5
6 ; Sink should sink the load past the store (which doesn't overlap) into
7 ; the block that uses it.
8
9 ;      CHECK: @foo
10 ;      CHECK: true:
11 ; CHECK-NEXT: %l = load i32* @A
12 ; CHECK-NEXT: ret i32 %l
13
14 define i32 @foo(i1 %z) {
15   %l = load i32* @A
16   store i32 0, i32* @B
17   br i1 %z, label %true, label %false
18 true:
19   ret i32 %l
20 false:
21   ret i32 0
22 }