1 ; RUN: opt -mergereturn -enable-new-pm=0 -S < %s | FileCheck %s
2 ; RUN: opt -passes='break-crit-edges,lowerswitch,mergereturn' -S < %s | FileCheck %s
4 ; The pass did previously not report the correct Modified status in the case
5 ; where a function had at most one return block, and an unified unreachable
6 ; block was created. This was caught by the pass return status check that is
7 ; hidden under EXPENSIVE_CHECKS.
9 ; CHECK: for.foo.body2:
10 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
13 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
15 ; CHECK: UnifiedUnreachableBlock:
16 ; CHECK-NEXT: unreachable
20 br label %for.foo.cond
22 for.foo.cond: ; preds = %entry
23 br i1 false, label %for.foo.body, label %for.foo.end3
25 for.foo.body: ; preds = %for.foo.cond
26 br label %for.foo.cond1
28 for.foo.cond1: ; preds = %for.foo.body
29 br i1 false, label %for.foo.body2, label %for.foo.end
31 for.foo.body2: ; preds = %for.foo.cond1
34 for.foo.end: ; preds = %for.foo.cond1
37 for.foo.end3: ; preds = %for.foo.cond
41 ; CHECK: for.bar.body2:
42 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
45 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
47 ; CHECK: UnifiedUnreachableBlock:
48 ; CHECK-NEXT: unreachable
52 br label %for.bar.cond
54 for.bar.cond: ; preds = %entry
55 br i1 false, label %for.bar.body, label %for.bar.end
57 for.bar.body: ; preds = %for.bar.cond
58 br label %for.bar.cond1
60 for.bar.cond1: ; preds = %for.bar.body
61 br i1 false, label %for.bar.body2, label %for.bar.end
63 for.bar.body2: ; preds = %for.bar.cond1
66 for.bar.end: ; preds = %for.bar.cond1