llvm.org GIT mirror llvm / 541a4fd
[RegionInfo] Add three tests that include infinite loops These examples are variations that were inspired from a small subgraph taken from paper.ll which are interesting as they show certain issues with infinite loops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286450 91177308-0d34-0410-b5e6-96231b3b80d8 Tobias Grosser 3 years ago
3 changed file(s) with 71 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt -regions -analyze < %s | FileCheck %s
1
2 define void @normal_condition() nounwind {
3 0:
4 br label %"7"
5 7:
6 br i1 1, label %"1", label %"8"
7 1:
8 br i1 1, label %"6", label %"3"
9 6:
10 br label %"8"
11 8:
12 br label %"8"
13 3:
14 br label %"4"
15 4:
16 ret void
17 }
18
19 ; CHECK: Region tree:
20 ; CHECK-NEXT: [0] 0 =>
21 ; CHECK-NEXT: [1] 7 => 3
22 ; CHECK-NEXT: End region tree
23
0 ; RUN: opt -regions -analyze < %s | FileCheck %s
1
2 define void @normal_condition() nounwind {
3 0:
4 br label %"7"
5 7:
6 br i1 1, label %"1", label %"9"
7 9:
8 br label %"8"
9 1:
10 br i1 1, label %"6", label %"3"
11 6:
12 br label %"9"
13 8:
14 br label %"8"
15 3:
16 br label %"4"
17 4:
18 ret void
19 }
20
21 ; CHECK: Region tree:
22 ; CHECK-NEXT: [0] 0 =>
23 ; CHECK-NEXT: [1] 7 => 3
24 ; CHECK-NEXT: End region tree
0 ; RUN: opt -regions -analyze < %s | FileCheck %s
1
2 define void @normal_condition() nounwind {
3 0:
4 br label %"7"
5 7:
6 br i1 1, label %"1", label %"8"
7 1:
8 br i1 1, label %"6", label %"3"
9 6:
10 br label %"8"
11 8:
12 br i1 1, label %"8", label %"7"
13 3:
14 br label %"4"
15 4:
16 ret void
17 }
18
19 ; CHECK: [0] 0 =>
20 ; CHECK-NEXT: [1] 7 => 3
21 ; CHECK-NEXT: [2] 8 => 7