diff options
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG/branch-fold-test.ll')
-rw-r--r-- | llvm/test/Transforms/SimplifyCFG/branch-fold-test.ll | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/branch-fold-test.ll b/llvm/test/Transforms/SimplifyCFG/branch-fold-test.ll new file mode 100644 index 00000000000..460f2456d8c --- /dev/null +++ b/llvm/test/Transforms/SimplifyCFG/branch-fold-test.ll @@ -0,0 +1,17 @@ +; This test ensures that the simplifycfg pass continues to constant fold +; terminator instructions. + +; RUN: opt < %s -simplifycfg -S | not grep br + +define i32 @test(i32 %A, i32 %B) { +J: + %C = add i32 %A, 12 ; <i32> [#uses=2] + br i1 true, label %L, label %K +L: ; preds = %J + %D = add i32 %C, %B ; <i32> [#uses=1] + ret i32 %D +K: ; preds = %J + %E = add i32 %C, %B ; <i32> [#uses=1] + ret i32 %E +} + |