Chandler Carruth | 52eef88 | 2014-01-12 12:15:39 +0000 | [diff] [blame] | 1 | ; This test is essentially doing very basic things with the opt tool and the |
| 2 | ; new pass manager pipeline. It will be used to flesh out the feature |
| 3 | ; completeness of the opt tool when the new pass manager is engaged. The tests |
| 4 | ; may not be useful once it becomes the default or may get spread out into other |
| 5 | ; files, but for now this is just going to step the new process through its |
| 6 | ; paces. |
| 7 | |
| 8 | ; RUN: opt -disable-output -debug-pass-manager -passes=print %s 2>&1 \ |
| 9 | ; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-PRINT |
| 10 | ; CHECK-MODULE-PRINT: Starting module pass manager |
Chandler Carruth | 4d35631 | 2014-01-20 11:34:08 +0000 | [diff] [blame] | 11 | ; CHECK-MODULE-PRINT: Running module pass: VerifierPass |
Chandler Carruth | 52eef88 | 2014-01-12 12:15:39 +0000 | [diff] [blame] | 12 | ; CHECK-MODULE-PRINT: Running module pass: PrintModulePass |
| 13 | ; CHECK-MODULE-PRINT: ModuleID |
| 14 | ; CHECK-MODULE-PRINT: define void @foo() |
Chandler Carruth | 4d35631 | 2014-01-20 11:34:08 +0000 | [diff] [blame] | 15 | ; CHECK-MODULE-PRINT: Running module pass: VerifierPass |
Chandler Carruth | 52eef88 | 2014-01-12 12:15:39 +0000 | [diff] [blame] | 16 | ; CHECK-MODULE-PRINT: Finished module pass manager |
| 17 | |
Chandler Carruth | 9c31db4 | 2015-01-05 00:08:53 +0000 | [diff] [blame] | 18 | ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='print,verify' %s 2>&1 \ |
| 19 | ; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-VERIFY |
| 20 | ; CHECK-MODULE-VERIFY: Starting module pass manager |
| 21 | ; CHECK-MODULE-VERIFY: Running module pass: PrintModulePass |
| 22 | ; CHECK-MODULE-VERIFY: ModuleID |
| 23 | ; CHECK-MODULE-VERIFY: define void @foo() |
| 24 | ; CHECK-MODULE-VERIFY: Running module pass: VerifierPass |
| 25 | ; CHECK-MODULE-VERIFY: Finished module pass manager |
| 26 | |
Chandler Carruth | 52eef88 | 2014-01-12 12:15:39 +0000 | [diff] [blame] | 27 | ; RUN: opt -disable-output -debug-pass-manager -passes='function(print)' %s 2>&1 \ |
| 28 | ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PRINT |
| 29 | ; CHECK-FUNCTION-PRINT: Starting module pass manager |
Chandler Carruth | 4d35631 | 2014-01-20 11:34:08 +0000 | [diff] [blame] | 30 | ; CHECK-FUNCTION-PRINT: Running module pass: VerifierPass |
Chandler Carruth | e5e8fb3 | 2015-01-05 12:21:44 +0000 | [diff] [blame] | 31 | ; CHECK-FUNCTION-PRINT: Running module pass: ModuleToFunctionPassAdaptor |
| 32 | ; CHECK-FUNCTION-PRINT: Running module analysis: FunctionAnalysisManagerModuleProxy |
Chandler Carruth | 52eef88 | 2014-01-12 12:15:39 +0000 | [diff] [blame] | 33 | ; CHECK-FUNCTION-PRINT: Starting function pass manager |
| 34 | ; CHECK-FUNCTION-PRINT: Running function pass: PrintFunctionPass |
| 35 | ; CHECK-FUNCTION-PRINT-NOT: ModuleID |
| 36 | ; CHECK-FUNCTION-PRINT: define void @foo() |
| 37 | ; CHECK-FUNCTION-PRINT: Finished function pass manager |
Chandler Carruth | 4d35631 | 2014-01-20 11:34:08 +0000 | [diff] [blame] | 38 | ; CHECK-FUNCTION-PRINT: Running module pass: VerifierPass |
Chandler Carruth | 52eef88 | 2014-01-12 12:15:39 +0000 | [diff] [blame] | 39 | ; CHECK-FUNCTION-PRINT: Finished module pass manager |
| 40 | |
Chandler Carruth | 9c31db4 | 2015-01-05 00:08:53 +0000 | [diff] [blame] | 41 | ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='function(print,verify)' %s 2>&1 \ |
| 42 | ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-VERIFY |
| 43 | ; CHECK-FUNCTION-VERIFY: Starting module pass manager |
| 44 | ; CHECK-FUNCTION-VERIFY: Starting function pass manager |
| 45 | ; CHECK-FUNCTION-VERIFY: Running function pass: PrintFunctionPass |
| 46 | ; CHECK-FUNCTION-VERIFY-NOT: ModuleID |
| 47 | ; CHECK-FUNCTION-VERIFY: define void @foo() |
| 48 | ; CHECK-FUNCTION-VERIFY: Running function pass: VerifierPass |
| 49 | ; CHECK-FUNCTION-VERIFY: Finished function pass manager |
| 50 | ; CHECK-FUNCTION-VERIFY: Finished module pass manager |
| 51 | |
Chandler Carruth | b353c3f | 2014-01-13 05:16:45 +0000 | [diff] [blame] | 52 | ; RUN: opt -S -o - -passes='no-op-module,no-op-module' %s \ |
| 53 | ; RUN: | FileCheck %s --check-prefix=CHECK-NOOP |
| 54 | ; CHECK-NOOP: define void @foo() { |
| 55 | ; CHECK-NOOP: ret void |
| 56 | ; CHECK-NOOP: } |
| 57 | |
Chandler Carruth | b7bdfd6 | 2014-01-13 07:38:24 +0000 | [diff] [blame] | 58 | ; Round trip through bitcode. |
| 59 | ; RUN: opt -f -o - -passes='no-op-module,no-op-module' %s \ |
| 60 | ; RUN: | llvm-dis \ |
| 61 | ; RUN: | FileCheck %s --check-prefix=CHECK-NOOP |
| 62 | |
Chandler Carruth | 4d35631 | 2014-01-20 11:34:08 +0000 | [diff] [blame] | 63 | ; RUN: opt -disable-output -debug-pass-manager -verify-each -passes='no-op-module,function(no-op-function)' %s 2>&1 \ |
| 64 | ; RUN: | FileCheck %s --check-prefix=CHECK-VERIFY-EACH |
| 65 | ; CHECK-VERIFY-EACH: Starting module pass manager |
| 66 | ; CHECK-VERIFY-EACH: Running module pass: VerifierPass |
| 67 | ; CHECK-VERIFY-EACH: Running module pass: NoOpModulePass |
| 68 | ; CHECK-VERIFY-EACH: Running module pass: VerifierPass |
| 69 | ; CHECK-VERIFY-EACH: Starting function pass manager |
| 70 | ; CHECK-VERIFY-EACH: Running function pass: NoOpFunctionPass |
| 71 | ; CHECK-VERIFY-EACH: Running function pass: VerifierPass |
| 72 | ; CHECK-VERIFY-EACH: Finished function pass manager |
| 73 | ; CHECK-VERIFY-EACH: Running module pass: VerifierPass |
| 74 | ; CHECK-VERIFY-EACH: Finished module pass manager |
| 75 | |
| 76 | ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='no-op-module,function(no-op-function)' %s 2>&1 \ |
| 77 | ; RUN: | FileCheck %s --check-prefix=CHECK-NO-VERIFY |
| 78 | ; CHECK-NO-VERIFY: Starting module pass manager |
| 79 | ; CHECK-NO-VERIFY-NOT: VerifierPass |
| 80 | ; CHECK-NO-VERIFY: Running module pass: NoOpModulePass |
| 81 | ; CHECK-NO-VERIFY-NOT: VerifierPass |
| 82 | ; CHECK-NO-VERIFY: Starting function pass manager |
| 83 | ; CHECK-NO-VERIFY: Running function pass: NoOpFunctionPass |
| 84 | ; CHECK-NO-VERIFY-NOT: VerifierPass |
| 85 | ; CHECK-NO-VERIFY: Finished function pass manager |
| 86 | ; CHECK-NO-VERIFY-NOT: VerifierPass |
| 87 | ; CHECK-NO-VERIFY: Finished module pass manager |
| 88 | |
Chandler Carruth | e5e8fb3 | 2015-01-05 12:21:44 +0000 | [diff] [blame] | 89 | ; RUN: opt -disable-output -debug-pass-manager -debug-cgscc-pass-manager -passes='cgscc(no-op-cgscc)' %s 2>&1 \ |
| 90 | ; RUN: | FileCheck %s --check-prefix=CHECK-LCG-ANALYSIS |
| 91 | ; CHECK-LCG-ANALYSIS: Starting module pass manager |
| 92 | ; CHECK-LCG-ANALYSIS: Running module pass: ModuleToPostOrderCGSCCPassAdaptor |
| 93 | ; CHECK-LCG-ANALYSIS: Running module analysis: CGSCCAnalysisManagerModuleProxy |
| 94 | ; CHECK-LCG-ANALYSIS: Running module analysis: Lazy CallGraph Analysis |
| 95 | ; CHECK-LCG-ANALYSIS: Starting CGSCC pass manager run. |
| 96 | |
Chandler Carruth | 539dc4b | 2015-01-05 12:32:11 +0000 | [diff] [blame^] | 97 | ; Make sure no-op passes that preserve all analyses don't even try to do any |
| 98 | ; analysis invalidation. |
| 99 | ; RUN: opt -disable-output -debug-pass-manager -debug-cgscc-pass-manager -passes='cgscc(function(no-op-function))' %s 2>&1 \ |
| 100 | ; RUN: | FileCheck %s --check-prefix=CHECK-NO-OP-INVALIDATION |
| 101 | ; CHECK-NO-OP-INVALIDATION: Starting module pass manager |
| 102 | ; CHECK-NO-OP-INVALIDATION-NOT: Invalidating all non-preserved analyses |
| 103 | |
Chandler Carruth | 52eef88 | 2014-01-12 12:15:39 +0000 | [diff] [blame] | 104 | define void @foo() { |
| 105 | ret void |
| 106 | } |