blob: 2c565e6944cdbf159e9c18e60e4a3c7ba660a091 [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
Chandler Carruth9c31db42015-01-05 00:08:53 +000018; 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 Carruth52eef882014-01-12 12:15:39 +000027; 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 Carruth4d356312014-01-20 11:34:08 +000030; CHECK-FUNCTION-PRINT: Running module pass: VerifierPass
Chandler Carruth52eef882014-01-12 12:15:39 +000031; CHECK-FUNCTION-PRINT: Starting function pass manager
32; CHECK-FUNCTION-PRINT: Running function pass: PrintFunctionPass
33; CHECK-FUNCTION-PRINT-NOT: ModuleID
34; CHECK-FUNCTION-PRINT: define void @foo()
35; CHECK-FUNCTION-PRINT: Finished function pass manager
Chandler Carruth4d356312014-01-20 11:34:08 +000036; CHECK-FUNCTION-PRINT: Running module pass: VerifierPass
Chandler Carruth52eef882014-01-12 12:15:39 +000037; CHECK-FUNCTION-PRINT: Finished module pass manager
38
Chandler Carruth9c31db42015-01-05 00:08:53 +000039; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='function(print,verify)' %s 2>&1 \
40; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-VERIFY
41; CHECK-FUNCTION-VERIFY: Starting module pass manager
42; CHECK-FUNCTION-VERIFY: Starting function pass manager
43; CHECK-FUNCTION-VERIFY: Running function pass: PrintFunctionPass
44; CHECK-FUNCTION-VERIFY-NOT: ModuleID
45; CHECK-FUNCTION-VERIFY: define void @foo()
46; CHECK-FUNCTION-VERIFY: Running function pass: VerifierPass
47; CHECK-FUNCTION-VERIFY: Finished function pass manager
48; CHECK-FUNCTION-VERIFY: Finished module pass manager
49
Chandler Carruthb353c3f2014-01-13 05:16:45 +000050; RUN: opt -S -o - -passes='no-op-module,no-op-module' %s \
51; RUN: | FileCheck %s --check-prefix=CHECK-NOOP
52; CHECK-NOOP: define void @foo() {
53; CHECK-NOOP: ret void
54; CHECK-NOOP: }
55
Chandler Carruthb7bdfd62014-01-13 07:38:24 +000056; Round trip through bitcode.
57; RUN: opt -f -o - -passes='no-op-module,no-op-module' %s \
58; RUN: | llvm-dis \
59; RUN: | FileCheck %s --check-prefix=CHECK-NOOP
60
Chandler Carruth4d356312014-01-20 11:34:08 +000061; RUN: opt -disable-output -debug-pass-manager -verify-each -passes='no-op-module,function(no-op-function)' %s 2>&1 \
62; RUN: | FileCheck %s --check-prefix=CHECK-VERIFY-EACH
63; CHECK-VERIFY-EACH: Starting module pass manager
64; CHECK-VERIFY-EACH: Running module pass: VerifierPass
65; CHECK-VERIFY-EACH: Running module pass: NoOpModulePass
66; CHECK-VERIFY-EACH: Running module pass: VerifierPass
67; CHECK-VERIFY-EACH: Starting function pass manager
68; CHECK-VERIFY-EACH: Running function pass: NoOpFunctionPass
69; CHECK-VERIFY-EACH: Running function pass: VerifierPass
70; CHECK-VERIFY-EACH: Finished function pass manager
71; CHECK-VERIFY-EACH: Running module pass: VerifierPass
72; CHECK-VERIFY-EACH: Finished module pass manager
73
74; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='no-op-module,function(no-op-function)' %s 2>&1 \
75; RUN: | FileCheck %s --check-prefix=CHECK-NO-VERIFY
76; CHECK-NO-VERIFY: Starting module pass manager
77; CHECK-NO-VERIFY-NOT: VerifierPass
78; CHECK-NO-VERIFY: Running module pass: NoOpModulePass
79; CHECK-NO-VERIFY-NOT: VerifierPass
80; CHECK-NO-VERIFY: Starting function pass manager
81; CHECK-NO-VERIFY: Running function pass: NoOpFunctionPass
82; CHECK-NO-VERIFY-NOT: VerifierPass
83; CHECK-NO-VERIFY: Finished function pass manager
84; CHECK-NO-VERIFY-NOT: VerifierPass
85; CHECK-NO-VERIFY: Finished module pass manager
86
Chandler Carruth52eef882014-01-12 12:15:39 +000087define void @foo() {
88 ret void
89}