blob: cec01b54ff0cd860ff1c9c7dd9eda8bd406c5f5c [file] [log] [blame]
Chandler Carruth52eef882014-01-12 12:15:39 +00001; 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 Carruth4d356312014-01-20 11:34:08 +000011; CHECK-MODULE-PRINT: Running module pass: VerifierPass
Chandler Carruth52eef882014-01-12 12:15:39 +000012; CHECK-MODULE-PRINT: Running module pass: PrintModulePass
13; CHECK-MODULE-PRINT: ModuleID
14; CHECK-MODULE-PRINT: define void @foo()
Chandler Carruth4d356312014-01-20 11:34:08 +000015; CHECK-MODULE-PRINT: Running module pass: VerifierPass
Chandler Carruth52eef882014-01-12 12:15:39 +000016; CHECK-MODULE-PRINT: Finished module pass manager
17
18; RUN: opt -disable-output -debug-pass-manager -passes='function(print)' %s 2>&1 \
19; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PRINT
20; CHECK-FUNCTION-PRINT: Starting module pass manager
Chandler Carruth4d356312014-01-20 11:34:08 +000021; CHECK-FUNCTION-PRINT: Running module pass: VerifierPass
Chandler Carruth52eef882014-01-12 12:15:39 +000022; CHECK-FUNCTION-PRINT: Starting function pass manager
23; CHECK-FUNCTION-PRINT: Running function pass: PrintFunctionPass
24; CHECK-FUNCTION-PRINT-NOT: ModuleID
25; CHECK-FUNCTION-PRINT: define void @foo()
26; CHECK-FUNCTION-PRINT: Finished function pass manager
Chandler Carruth4d356312014-01-20 11:34:08 +000027; CHECK-FUNCTION-PRINT: Running module pass: VerifierPass
Chandler Carruth52eef882014-01-12 12:15:39 +000028; CHECK-FUNCTION-PRINT: Finished module pass manager
29
Chandler Carruthb353c3f2014-01-13 05:16:45 +000030; RUN: opt -S -o - -passes='no-op-module,no-op-module' %s \
31; RUN: | FileCheck %s --check-prefix=CHECK-NOOP
32; CHECK-NOOP: define void @foo() {
33; CHECK-NOOP: ret void
34; CHECK-NOOP: }
35
Chandler Carruthb7bdfd62014-01-13 07:38:24 +000036; Round trip through bitcode.
37; RUN: opt -f -o - -passes='no-op-module,no-op-module' %s \
38; RUN: | llvm-dis \
39; RUN: | FileCheck %s --check-prefix=CHECK-NOOP
40
Chandler Carruth4d356312014-01-20 11:34:08 +000041; RUN: opt -disable-output -debug-pass-manager -verify-each -passes='no-op-module,function(no-op-function)' %s 2>&1 \
42; RUN: | FileCheck %s --check-prefix=CHECK-VERIFY-EACH
43; CHECK-VERIFY-EACH: Starting module pass manager
44; CHECK-VERIFY-EACH: Running module pass: VerifierPass
45; CHECK-VERIFY-EACH: Running module pass: NoOpModulePass
46; CHECK-VERIFY-EACH: Running module pass: VerifierPass
47; CHECK-VERIFY-EACH: Starting function pass manager
48; CHECK-VERIFY-EACH: Running function pass: NoOpFunctionPass
49; CHECK-VERIFY-EACH: Running function pass: VerifierPass
50; CHECK-VERIFY-EACH: Finished function pass manager
51; CHECK-VERIFY-EACH: Running module pass: VerifierPass
52; CHECK-VERIFY-EACH: Finished module pass manager
53
54; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='no-op-module,function(no-op-function)' %s 2>&1 \
55; RUN: | FileCheck %s --check-prefix=CHECK-NO-VERIFY
56; CHECK-NO-VERIFY: Starting module pass manager
57; CHECK-NO-VERIFY-NOT: VerifierPass
58; CHECK-NO-VERIFY: Running module pass: NoOpModulePass
59; CHECK-NO-VERIFY-NOT: VerifierPass
60; CHECK-NO-VERIFY: Starting function pass manager
61; CHECK-NO-VERIFY: Running function pass: NoOpFunctionPass
62; CHECK-NO-VERIFY-NOT: VerifierPass
63; CHECK-NO-VERIFY: Finished function pass manager
64; CHECK-NO-VERIFY-NOT: VerifierPass
65; CHECK-NO-VERIFY: Finished module pass manager
66
Chandler Carruth52eef882014-01-12 12:15:39 +000067define void @foo() {
68 ret void
69}