blob: 417f847e64a6720aefa13c005bb205e0a09715fb [file] [log] [blame]
Chris Lattnera1ab9592002-05-02 20:41:39 +00001; This is a basic sanity check for constant propogation. The add instruction
2; should be eliminated.
3
Reid Spencer69ccadd2006-12-02 04:23:10 +00004; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | not grep add
Chris Lattnera1ab9592002-05-02 20:41:39 +00005
Chris Lattner50e86822003-06-28 23:23:34 +00006int %test(bool %B) {
Chris Lattnera1ab9592002-05-02 20:41:39 +00007 br bool %B, label %BB1, label %BB2
8BB1:
9 %Val = add int 0, 0
10 br label %BB3
11BB2:
12 br label %BB3
13BB3:
14 %Ret = phi int [%Val, %BB1], [1, %BB2]
15 ret int %Ret
Chris Lattner50e86822003-06-28 23:23:34 +000016}