summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/Dominators/basic.ll
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-01-14 03:34:55 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-01-14 03:34:55 +0000
commitef7a9fb63bfb045160f33a3e7b8107246a3db999 (patch)
treef2d4f905908d28942bab2be0b33a73b993197058 /llvm/test/Analysis/Dominators/basic.ll
parente28d154cd5f1c2fc91cae530a4b2c9eb3e5e76e5 (diff)
downloadbcm5719-llvm-ef7a9fb63bfb045160f33a3e7b8107246a3db999.tar.gz
bcm5719-llvm-ef7a9fb63bfb045160f33a3e7b8107246a3db999.zip
[dom] Add a basic dominator tree test.
Correct, we have *zero* basic testing of the dominator tree in the regression test suite. There is a single test that even prints it out, and that test only checks a single line of the output. There are a handful of tests that check post dominators, but all of those are looking for bugs rather than just exercising the basic machinery. This test is super boring and unexciting. But hey, it's something. I needed there to be something so I could switch the basic test to run with both the old and new pass manager. llvm-svn: 225936
Diffstat (limited to 'llvm/test/Analysis/Dominators/basic.ll')
-rw-r--r--llvm/test/Analysis/Dominators/basic.ll57
1 files changed, 57 insertions, 0 deletions
diff --git a/llvm/test/Analysis/Dominators/basic.ll b/llvm/test/Analysis/Dominators/basic.ll
new file mode 100644
index 00000000000..8627a87b557
--- /dev/null
+++ b/llvm/test/Analysis/Dominators/basic.ll
@@ -0,0 +1,57 @@
+; RUN: opt < %s -domtree -analyze | FileCheck %s
+
+define void @test1() {
+; CHECK-LABEL: 'Dominator Tree Construction' for function 'test1':
+; CHECK: [1] %entry
+; CHECK-NEXT: [2] %a
+; CHECK-NEXT: [2] %c
+; CHECK-NEXT: [3] %d
+; CHECK-NEXT: [3] %e
+; CHECK-NEXT: [2] %b
+
+entry:
+ br i1 undef, label %a, label %b
+
+a:
+ br label %c
+
+b:
+ br label %c
+
+c:
+ br i1 undef, label %d, label %e
+
+d:
+ ret void
+
+e:
+ ret void
+}
+
+define void @test2() {
+; CHECK-LABEL: 'Dominator Tree Construction' for function 'test2':
+; CHECK: [1] %entry
+; CHECK-NEXT: [2] %a
+; CHECK-NEXT: [3] %b
+; CHECK-NEXT: [4] %c
+; CHECK-NEXT: [5] %d
+; CHECK-NEXT: [5] %ret
+
+entry:
+ br label %a
+
+a:
+ br label %b
+
+b:
+ br i1 undef, label %a, label %c
+
+c:
+ br i1 undef, label %d, label %ret
+
+d:
+ br i1 undef, label %a, label %ret
+
+ret:
+ ret void
+}
OpenPOWER on IntegriCloud