1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -dfa-jump-threading -sccp -simplifycfg %s | FileCheck %s
4 ; This test checks that a constant propagation is applied for a basic loop.
5 ; Related to bug 44679.
6 define i32 @test(i32 %a) {
9 ; CHECK-NEXT: ret i32 3
15 %num = phi i32 [ 0, %entry ], [ %add, %case1 ]
16 %state = phi i32 [ 1, %entry ], [ %state.next, %case1 ]
17 switch i32 %state, label %end [
23 %state.next = phi i32 [ 3, %case2 ], [ 2, %while.cond ]
24 %add = add nsw i32 %num, %state