blob: 39a70ab5da7ed4d649c64a2f6d0712094a892965 [file] [log] [blame]
Dan Gohman3e054fe2009-09-08 22:34:10 +00001; RUN: opt %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
Nick Lewyckyf23d0d32008-12-19 06:39:12 +00002
3declare i32* @test(i32* nocapture)
4
5define i32 @test2() {
6 %P = alloca i32
7 %Q = call i32* @test(i32* %P)
8 %a = load i32* %P
9 store i32 4, i32* %Q ;; cannot clobber P since it is nocapture.
10 %b = load i32* %P
11 %c = sub i32 %a, %b
12 ret i32 %c
13}
14