blob: f6f7db933d39213e074024465b50294fdd4c372d [file] [log] [blame]
Chris Lattnerac39b4e2002-08-22 17:31:36 +00001; Test that GCSE uses basicaa to do alias analysis, which is capable of
2; disambiguating some obvious cases. All loads should be removable in
3; this testcase.
4
5; RUN: if as < %s | opt -basicaa -gcse -instcombine -dce | dis | grep load
6; RUN: then exit 1
7; RUN: else exit 0
8; RUN: fi
9
10%A = global int 7
11%B = global int 8
12implementation
13
14int %test() {
15 %A1 = load int* %A
16
17 store int 123, int* %B ; Store cannot alias %A
18
19 %A2 = load int* %A
20 %X = sub int %A1, %A2
21 ret int %X
22}
23