blob: b575f5ba75dedc18d8a71cd399c7857926319af6 [file] [log] [blame]
Chris Lattner04b9d292002-09-24 16:13:20 +00001; This test ensures that the simplifycfg pass continues to constant fold
2; terminator instructions.
3
Dan Gohmanb1e1e822009-09-08 16:50:01 +00004; RUN: opt %s -simplifycfg | llvm-dis | not grep br
Chris Lattner04b9d292002-09-24 16:13:20 +00005
Tanya Lattnerf04d8d12008-03-18 03:45:45 +00006define i32 @test(i32 %A, i32 %B) {
Chris Lattner04b9d292002-09-24 16:13:20 +00007J:
Tanya Lattnerf04d8d12008-03-18 03:45:45 +00008 %C = add i32 %A, 12 ; <i32> [#uses=2]
9 br i1 true, label %L, label %K
10L: ; preds = %J
11 %D = add i32 %C, %B ; <i32> [#uses=1]
12 ret i32 %D
13K: ; preds = %J
14 %E = add i32 %C, %B ; <i32> [#uses=1]
15 ret i32 %E
Chris Lattner04b9d292002-09-24 16:13:20 +000016}
Tanya Lattnerf04d8d12008-03-18 03:45:45 +000017