summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/CodeGen/Generic/print-after.ll6
-rw-r--r--llvm/tools/llc/llc.cpp4
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Generic/print-after.ll b/llvm/test/CodeGen/Generic/print-after.ll
new file mode 100644
index 00000000000..0c4695dce56
--- /dev/null
+++ b/llvm/test/CodeGen/Generic/print-after.ll
@@ -0,0 +1,6 @@
+; RUN: not llc --help-hidden |& FileCheck %s
+
+; CHECK: -print-after
+; CHECK-NOT: -print-after-all
+; CHECK: =simple-register-coalescing
+; CHECK: -print-after-all
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 44f83e1b307..9b3ef8144c8 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -353,6 +353,10 @@ int main(int argc, char **argv) {
InitializeAllAsmPrinters();
InitializeAllAsmParsers();
+ // Initialize codegen so that the -print-after and -print-before options
+ // work.
+ initializeCodeGen(*PassRegistry::getPassRegistry());
+
// Register the target printer for --version.
cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
OpenPOWER on IntegriCloud