summaryrefslogtreecommitdiff
path: root/test/Other
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-01-12 12:15:39 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-01-12 12:15:39 +0000
commita59525786d39de4af8d7ee65531c220348ec48b6 (patch)
treec31cf0ba4e85bc2dd06c56b8687489dd24a17750 /test/Other
parent895ada05e91c427afc8c19d1c4267434325948f6 (diff)
downloadllvm-a59525786d39de4af8d7ee65531c220348ec48b6.tar.gz
llvm-a59525786d39de4af8d7ee65531c220348ec48b6.tar.bz2
llvm-a59525786d39de4af8d7ee65531c220348ec48b6.tar.xz
[PM] Add module and function printing passes for the new pass manager.
This implements the legacy passes in terms of the new ones. It adds basic testing using explicit runs of the passes. Next up will be wiring the basic output mechanism of opt up when the new pass manager is engaged unless bitcode writing is requested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199049 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other')
-rw-r--r--test/Other/new-pass-manager.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Other/new-pass-manager.ll b/test/Other/new-pass-manager.ll
new file mode 100644
index 0000000000..48b97624b8
--- /dev/null
+++ b/test/Other/new-pass-manager.ll
@@ -0,0 +1,28 @@
+; This test is essentially doing very basic things with the opt tool and the
+; new pass manager pipeline. It will be used to flesh out the feature
+; completeness of the opt tool when the new pass manager is engaged. The tests
+; may not be useful once it becomes the default or may get spread out into other
+; files, but for now this is just going to step the new process through its
+; paces.
+
+; RUN: opt -disable-output -debug-pass-manager -passes=print %s 2>&1 \
+; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-PRINT
+; CHECK-MODULE-PRINT: Starting module pass manager
+; CHECK-MODULE-PRINT: Running module pass: PrintModulePass
+; CHECK-MODULE-PRINT: ModuleID
+; CHECK-MODULE-PRINT: define void @foo()
+; CHECK-MODULE-PRINT: Finished module pass manager
+
+; RUN: opt -disable-output -debug-pass-manager -passes='function(print)' %s 2>&1 \
+; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PRINT
+; CHECK-FUNCTION-PRINT: Starting module pass manager
+; CHECK-FUNCTION-PRINT: Starting function pass manager
+; CHECK-FUNCTION-PRINT: Running function pass: PrintFunctionPass
+; CHECK-FUNCTION-PRINT-NOT: ModuleID
+; CHECK-FUNCTION-PRINT: define void @foo()
+; CHECK-FUNCTION-PRINT: Finished function pass manager
+; CHECK-FUNCTION-PRINT: Finished module pass manager
+
+define void @foo() {
+ ret void
+}