this test is pretty pointless and "propogation" isn't a word (or so Misha claims).
[oota-llvm.git] / test / Transforms / ConstProp / basictest.ll
1 ; RUN: opt < %s -constprop -die -S | FileCheck %s
2
3 ; This is a basic sanity check for constant propogation.  The add instruction 
4 ; should be eliminated.
5 define i32 @test1(i1 %B) {
6         br i1 %B, label %BB1, label %BB2
7
8 BB1:      
9         %Val = add i32 0, 0
10         br label %BB3
11
12 BB2:      
13         br label %BB3
14
15 BB3:     
16 ; CHECK: @test1
17 ; CHECK: %Ret = phi i32 [ 0, %BB1 ], [ 1, %BB2 ]
18         %Ret = phi i32 [ %Val, %BB1 ], [ 1, %BB2 ] 
19         ret i32 %Ret
20 }
21
22
23 ; PR6197
24 define i1 @test2(i8* %f) nounwind {
25 entry:
26   %V = icmp ne i8* blockaddress(@test2, %bb), null
27   br label %bb
28 bb:
29   ret i1 %V
30   
31 ; CHECK: @test2
32 ; CHECK: ret i1 true
33 }