blob: 444741f5b72d92ef9fa22297031396c2e1561691 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; This test ensures that the simplifycfg pass continues to constant fold
2; terminator instructions.
3
Evan Cheng5f6d9d72008-06-07 08:40:16 +00004; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005
Tanya Lattnerb46665e2008-03-18 03:45:45 +00006define i32 @test(i32 %A, i32 %B) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007J:
Tanya Lattnerb46665e2008-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
Dan Gohmanf17a25c2007-07-18 16:29:46 +000016}
Tanya Lattnerb46665e2008-03-18 03:45:45 +000017