• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -regions -analyze < %s | FileCheck %s
2; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
3
4; We should not crash if there are some bbs that are not reachable.
5define void @f() {
6entry:
7  br label %for.pre
8
9notintree:                                        ; No predecessors!
10  br label %ret
11
12for.pre:                                          ; preds = %entry
13  br label %for
14
15for:                                              ; preds = %for.inc, %for.pre
16  %indvar = phi i64 [ 0, %for.pre ], [ %indvar.next, %for.inc ]
17  %exitcond = icmp ne i64 %indvar, 200
18  br i1 %exitcond, label %for.inc, label %ret
19
20for.inc:                                          ; preds = %for
21  %indvar.next = add i64 %indvar, 1
22  br label %for
23
24ret:                                              ; preds = %for, %notintree
25  ret void
26}
27
28; CHECK: [0] entry => <Function Return>
29; CHECK:   [1] for => ret
30
31