1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; This testcases makes sure that mem2reg can handle unreachable blocks.
3 ; RUN: opt < %s -passes=mem2reg -S | FileCheck %s
7 ; CHECK-NEXT: br label [[LOOP:%.*]]
9 ; CHECK-NEXT: br label [[ENDOFLOOP:%.*]]
11 ; CHECK-NEXT: br label [[ENDOFLOOP]]
13 ; CHECK-NEXT: br label [[LOOP]]
15 %X = alloca i32 ; <ptr> [#uses=2]
18 Loop: ; preds = %EndOfLoop, %0
21 Unreachable: ; No predecessors!
23 EndOfLoop: ; preds = %Unreachable, %Loop