[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / test / Transforms / UnifyFunctionExitNodes / unreachable-blocks-status.ll
blobdbbb5ae91a01d84b768c029c69159da778379219
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
11 ; CHECK: for.foo.end:
12 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
14 ; CHECK: UnifiedUnreachableBlock:
15 ; CHECK-NEXT: unreachable
17 define i32 @foo() {
18 entry:
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
31   unreachable
33 for.foo.end:                                          ; preds = %for.foo.cond1
34   unreachable
36 for.foo.end3:                                         ; preds = %for.foo.cond
37   ret i32 undef
40 ; CHECK: for.bar.body2:
41 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
43 ; CHECK: for.bar.end:
44 ; CHECK-NEXT: br label %UnifiedUnreachableBlock
46 ; CHECK: UnifiedUnreachableBlock:
47 ; CHECK-NEXT: unreachable
49 define void @bar() {
50 entry:
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
63   unreachable
65 for.bar.end:                                          ; preds = %for.bar.cond1
66   unreachable