• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -domtree -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-OLDPM
2; RUN: opt < %s -disable-output -passes='print<domtree>' 2>&1 | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-NEWPM
3
4define void @test1() {
5; CHECK-OLDPM-LABEL: 'Dominator Tree Construction' for function 'test1':
6; CHECK-NEWPM-LABEL: DominatorTree for function: test1
7; CHECK:      [1] %entry
8; CHECK-NEXT:   [2] %a
9; CHECK-NEXT:   [2] %c
10; CHECK-NEXT:     [3] %d
11; CHECK-NEXT:     [3] %e
12; CHECK-NEXT:   [2] %b
13
14entry:
15  br i1 undef, label %a, label %b
16
17a:
18  br label %c
19
20b:
21  br label %c
22
23c:
24  br i1 undef, label %d, label %e
25
26d:
27  ret void
28
29e:
30  ret void
31}
32
33define void @test2() {
34; CHECK-OLDPM-LABEL: 'Dominator Tree Construction' for function 'test2':
35; CHECK-NEWPM-LABEL: DominatorTree for function: test2
36; CHECK:      [1] %entry
37; CHECK-NEXT:   [2] %a
38; CHECK-NEXT:     [3] %b
39; CHECK-NEXT:       [4] %c
40; CHECK-NEXT:         [5] %d
41; CHECK-NEXT:         [5] %ret
42
43entry:
44  br label %a
45
46a:
47  br label %b
48
49b:
50  br i1 undef, label %a, label %c
51
52c:
53  br i1 undef, label %d, label %ret
54
55d:
56  br i1 undef, label %a, label %ret
57
58ret:
59  ret void
60}
61