llvm.org GIT mirror llvm / 5f405a9
RegionInfo: add new test case This test case has been reduced from test/Analysis/RegionInfo/mix_1.ll and provides us with a minimal example of a test case which caused problems while working on an improved version of the RegionInfo analysis. We upstream this test case, as it certainly can be helpful in future debugging and optimization tests. Test case reduced by Pratik Bhatu <cs12b1010@iith.ac.in> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290974 91177308-0d34-0410-b5e6-96231b3b80d8 Tobias Grosser 3 years ago
1 changed file(s) with 42 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; REQUIRES: asserts
1 ; RUN: opt -regions -analyze < %s | FileCheck %s
2
3 ; While working on improvements to the region info analysis, this test
4 ; case caused an incorrect region 3 => 8 to be detected.
5
6 define internal i8 @wibble() {
7 bb:
8 br i1 true, label %bb1, label %bb8
9
10 bb1: ; preds = %bb
11 switch i32 0, label %bb2 [
12 i32 0, label %bb3
13 i32 1, label %bb7
14 ]
15
16 bb2: ; preds = %bb1
17 br label %bb4
18
19 bb3: ; preds = %bb1
20 br label %bb5
21
22 bb4: ; preds = %bb2
23 br label %bb6
24
25 bb5: ; preds = %bb3
26 br label %bb6
27
28 bb6: ; preds = %bb5, %bb4
29 br label %bb7
30
31 bb7: ; preds = %bb6, %bb1
32 br label %bb8
33
34 bb8: ; preds = %bb7, %bb
35 ret i8 1
36 }
37
38 ; CHECK: [0] bb =>
39 ; CHECK-NEXT: [1] bb => bb8
40 ; CHECK-NEXT: [2] bb1 => bb7
41