1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; This test ensures that the simplifycfg pass continues to constant fold
3 ; terminator instructions.
5 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
7 define i32 @test(i32 %A, i32 %B) {
10 ; CHECK-NEXT: [[C:%.*]] = add i32 [[A:%.*]], 12
11 ; CHECK-NEXT: [[D:%.*]] = add i32 [[C]], [[B:%.*]]
12 ; CHECK-NEXT: ret i32 [[D]]
15 %C = add i32 %A, 12 ; <i32> [#uses=2]
16 br i1 true, label %L, label %K
18 %D = add i32 %C, %B ; <i32> [#uses=1]
21 %E = add i32 %C, %B ; <i32> [#uses=1]