Use InstrSlots::NUM rather than pre-dividing by four. Also, mark this const.
[oota-llvm.git] / test / Analysis / LoadVN / undefined_load.ll
1 ; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep load
2 ; Test that loads of undefined memory are eliminated.
3
4 define i32 @test1() {
5         %X = malloc i32         ; <i32*> [#uses=1]
6         %Y = load i32* %X               ; <i32> [#uses=1]
7         ret i32 %Y
8 }
9
10 define i32 @test2() {
11         %X = alloca i32         ; <i32*> [#uses=1]
12         %Y = load i32* %X               ; <i32> [#uses=1]
13         ret i32 %Y
14 }