1 ; RUN: opt -passes='break-crit-edges,lowerswitch,mergereturn' -S < %s | FileCheck %s
3 ; The pass did previously not report the correct Modified status in the case
4 ; where a function had at most one return block, and an unified unreachable
5 ; block was created. This was caught by the pass return status check that is
6 ; hidden under EXPENSIVE_CHECKS.
8 ; CHECK: for.foo.body2:
9 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
12 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
14 ; CHECK: UnifiedUnreachableBlock:
15 ; CHECK-NEXT: unreachable
19 br label %for.foo.cond
21 for.foo.cond: ; preds = %entry
22 br i1 false, label %for.foo.body, label %for.foo.end3
24 for.foo.body: ; preds = %for.foo.cond
25 br label %for.foo.cond1
27 for.foo.cond1: ; preds = %for.foo.body
28 br i1 false, label %for.foo.body2, label %for.foo.end
30 for.foo.body2: ; preds = %for.foo.cond1
33 for.foo.end: ; preds = %for.foo.cond1
36 for.foo.end3: ; preds = %for.foo.cond
40 ; CHECK: for.bar.body2:
41 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
44 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
46 ; CHECK: UnifiedUnreachableBlock:
47 ; CHECK-NEXT: unreachable
51 br label %for.bar.cond
53 for.bar.cond: ; preds = %entry
54 br i1 false, label %for.bar.body, label %for.bar.end
56 for.bar.body: ; preds = %for.bar.cond
57 br label %for.bar.cond1
59 for.bar.cond1: ; preds = %for.bar.body
60 br i1 false, label %for.bar.body2, label %for.bar.end
62 for.bar.body2: ; preds = %for.bar.cond1
65 for.bar.end: ; preds = %for.bar.cond1