blob: 54b7f1369de47a1f1e723b6ae62ac8f7f591c65a [file] [log] [blame]
Dan Gohmanc1be92f2010-10-18 18:04:47 +00001; RUN: opt < %s -basicaa -sink -S | FileCheck %s
Dan Gohman28a193e2010-05-07 15:40:13 +00002
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
14define i32 @foo(i1 %z) {
15 %l = load i32* @A
16 store i32 0, i32* @B
17 br i1 %z, label %true, label %false
18true:
19 ret i32 %l
20false:
21 ret i32 0
22}