[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / Other / pass-pipeline-parsing.ll
blob668b06de862c59c24653dcb8c51b8a42f7bec2ec
1 ; RUN: opt -disable-output -debug-pass-manager \
2 ; RUN:     -passes=no-op-module,no-op-module %s 2>&1 \
3 ; RUN:     | FileCheck %s --check-prefix=CHECK-TWO-NOOP-MP
4 ; CHECK-TWO-NOOP-MP: Running pass: NoOpModulePass
5 ; CHECK-TWO-NOOP-MP: Running pass: NoOpModulePass
7 ; RUN: opt -disable-output -debug-pass-manager \
8 ; RUN:     -passes='module(no-op-module,no-op-module)' %s 2>&1 \
9 ; RUN:     | FileCheck %s --check-prefix=CHECK-NESTED-TWO-NOOP-MP
10 ; CHECK-NESTED-TWO-NOOP-MP: Running pass: NoOpModulePass
11 ; CHECK-NESTED-TWO-NOOP-MP: Running pass: NoOpModulePass
13 ; RUN: opt -disable-output -debug-pass-manager \
14 ; RUN:     -passes=no-op-function,no-op-function %s 2>&1 \
15 ; RUN:     | FileCheck %s --check-prefix=CHECK-TWO-NOOP-FP
16 ; CHECK-TWO-NOOP-FP: Running pass: NoOpFunctionPass
17 ; CHECK-TWO-NOOP-FP: Running pass: NoOpFunctionPass
19 ; RUN: opt -disable-output -debug-pass-manager \
20 ; RUN:     -passes='function(no-op-function,no-op-function)' %s 2>&1 \
21 ; RUN:     | FileCheck %s --check-prefix=CHECK-NESTED-TWO-NOOP-FP
22 ; CHECK-NESTED-TWO-NOOP-FP: Running pass: NoOpFunctionPass
23 ; CHECK-NESTED-TWO-NOOP-FP: Running pass: NoOpFunctionPass
25 ; RUN: opt -disable-output -debug-pass-manager \
26 ; RUN:     -passes='no-op-module,function(no-op-function,no-op-function),no-op-module' %s 2>&1 \
27 ; RUN:     | FileCheck %s --check-prefix=CHECK-MIXED-FP-AND-MP
28 ; CHECK-MIXED-FP-AND-MP: Running pass: NoOpModulePass
29 ; CHECK-MIXED-FP-AND-MP: Running pass: NoOpFunctionPass
30 ; CHECK-MIXED-FP-AND-MP: Running pass: NoOpFunctionPass
31 ; CHECK-MIXED-FP-AND-MP: Running pass: NoOpModulePass
33 ; RUN: opt -disable-output -debug-pass-manager \
34 ; RUN:     -aa-pipeline= -passes='require<aa>' %s 2>&1 \
35 ; RUN:     | FileCheck %s --check-prefix=CHECK-EMPTY-AA
36 ; CHECK-EMPTY-AA: Running analysis: AAManager
37 ; CHECK-EMPTY-AA-NOT: Running analysis: BasicAA
39 ; RUN: opt -disable-output -debug-pass-manager \
40 ; RUN:     -aa-pipeline=basic-aa -passes='require<aa>' %s 2>&1 \
41 ; RUN:     | FileCheck %s --check-prefix=CHECK-BASIC-AA
42 ; CHECK-BASIC-AA: Running analysis: AAManager
43 ; CHECK-BASIC-AA: Running analysis: BasicAA
44 ; CHECK-BASIC-AA-NOT: Running analysis: TypeBasedAA
46 ; RUN: opt -disable-output -debug-pass-manager \
47 ; RUN:     -aa-pipeline=basic-aa,tbaa -passes='require<aa>' %s 2>&1 \
48 ; RUN:     | FileCheck %s --check-prefix=CHECK-TWO-AA
49 ; CHECK-TWO-AA: Running analysis: AAManager
50 ; CHECK-TWO-AA: Running analysis: BasicAA
51 ; CHECK-TWO-AA: Running analysis: TypeBasedAA
53 ; RUN: opt -disable-output -debug-pass-manager \
54 ; RUN:     -aa-pipeline=default -passes='require<aa>' %s 2>&1 \
55 ; RUN:     | FileCheck %s --check-prefix=CHECK-DEFAULT-AA
56 ; CHECK-DEFAULT-AA: Running analysis: AAManager
57 ; CHECK-DEFAULT-AA-DAG: Running analysis: BasicAA
58 ; CHECK-DEFAULT-AA-DAG: Running analysis: TypeBasedAA
60 ; RUN: not opt -disable-output -debug-pass-manager \
61 ; RUN:     -passes='no-op-module)' %s 2>&1 \
62 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED1
63 ; CHECK-UNBALANCED1: invalid pipeline 'no-op-module)'
65 ; RUN: not opt -disable-output -debug-pass-manager \
66 ; RUN:     -passes='module(no-op-module))' %s 2>&1 \
67 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED2
68 ; CHECK-UNBALANCED2: invalid pipeline 'module(no-op-module))'
70 ; RUN: not opt -disable-output -debug-pass-manager \
71 ; RUN:     -passes='module(no-op-module' %s 2>&1 \
72 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED3
73 ; CHECK-UNBALANCED3: invalid pipeline 'module(no-op-module'
75 ; RUN: not opt -disable-output -debug-pass-manager \
76 ; RUN:     -passes='no-op-function)' %s 2>&1 \
77 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED4
78 ; CHECK-UNBALANCED4: invalid pipeline 'no-op-function)'
80 ; RUN: not opt -disable-output -debug-pass-manager \
81 ; RUN:     -passes='function(no-op-function))' %s 2>&1 \
82 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED5
83 ; CHECK-UNBALANCED5: invalid pipeline 'function(no-op-function))'
85 ; RUN: not opt -disable-output -debug-pass-manager \
86 ; RUN:     -passes='function(function(no-op-function)))' %s 2>&1 \
87 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED6
88 ; CHECK-UNBALANCED6: invalid pipeline 'function(function(no-op-function)))'
90 ; RUN: not opt -disable-output -debug-pass-manager \
91 ; RUN:     -passes='function(no-op-function' %s 2>&1 \
92 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED7
93 ; CHECK-UNBALANCED7: invalid pipeline 'function(no-op-function'
95 ; RUN: not opt -disable-output -debug-pass-manager \
96 ; RUN:     -passes='function(function(no-op-function)' %s 2>&1 \
97 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED8
98 ; CHECK-UNBALANCED8: invalid pipeline 'function(function(no-op-function)'
100 ; RUN: not opt -disable-output -debug-pass-manager \
101 ; RUN:     -passes='no-op-module,)' %s 2>&1 \
102 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED9
103 ; CHECK-UNBALANCED9: invalid pipeline 'no-op-module,)'
105 ; RUN: not opt -disable-output -debug-pass-manager \
106 ; RUN:     -passes='no-op-function,)' %s 2>&1 \
107 ; RUN:     | FileCheck %s --check-prefix=CHECK-UNBALANCED10
108 ; CHECK-UNBALANCED10: invalid pipeline 'no-op-function,)'
110 ; RUN: opt -disable-output -debug-pass-manager \
111 ; RUN:     -passes=no-op-cgscc,no-op-cgscc %s 2>&1 \
112 ; RUN:     | FileCheck %s --check-prefix=CHECK-TWO-NOOP-CG
113 ; CHECK-TWO-NOOP-CG: Running pass: NoOpCGSCCPass
114 ; CHECK-TWO-NOOP-CG: Running pass: NoOpCGSCCPass
116 ; RUN: opt -disable-output -debug-pass-manager \
117 ; RUN:     -passes='module(function(no-op-function),cgscc(no-op-cgscc,function(no-op-function),no-op-cgscc),function(no-op-function))' %s 2>&1 \
118 ; RUN:     | FileCheck %s --check-prefix=CHECK-NESTED-MP-CG-FP
119 ; CHECK-NESTED-MP-CG-FP: Running pass: NoOpFunctionPass
120 ; CHECK-NESTED-MP-CG-FP: Running pass: NoOpCGSCCPass
121 ; CHECK-NESTED-MP-CG-FP: Running pass: NoOpFunctionPass
122 ; CHECK-NESTED-MP-CG-FP: Running pass: NoOpCGSCCPass
123 ; CHECK-NESTED-MP-CG-FP: Running pass: NoOpFunctionPass
125 ; RUN: opt -disable-output -debug-pass-manager \
126 ; RUN:     -passes='no-op-loop,no-op-loop' %s 2>&1 \
127 ; RUN:     | FileCheck %s --check-prefix=CHECK-TWO-NOOP-LOOP
128 ; CHECK-TWO-NOOP-LOOP: Running pass: NoOpLoopPass
129 ; CHECK-TWO-NOOP-LOOP: Running pass: NoOpLoopPass
131 ; RUN: opt -disable-output -debug-pass-manager \
132 ; RUN:     -passes='module(function(loop(no-op-loop)))' %s 2>&1 \
133 ; RUN:     | FileCheck %s --check-prefix=CHECK-NESTED-FP-LP
134 ; RUN: opt -disable-output -debug-pass-manager \
135 ; RUN:     -passes='function(loop(no-op-loop))' %s 2>&1 \
136 ; RUN:     | FileCheck %s --check-prefix=CHECK-NESTED-FP-LP
137 ; RUN: opt -disable-output -debug-pass-manager \
138 ; RUN:     -passes='loop(no-op-loop)' %s 2>&1 \
139 ; RUN:     | FileCheck %s --check-prefix=CHECK-NESTED-FP-LP
140 ; RUN: opt -disable-output -debug-pass-manager \
141 ; RUN:     -passes='no-op-loop' %s 2>&1 \
142 ; RUN:     | FileCheck %s --check-prefix=CHECK-NESTED-FP-LP
143 ; CHECK-NESTED-FP-LP: Running pass: NoOpLoopPass
145 ; RUN: opt -disable-output -debug-pass-manager=verbose \
146 ; RUN:     -passes='module(no-op-function,no-op-loop,no-op-cgscc,cgscc(no-op-function,no-op-loop),function(no-op-loop))' %s 2>&1 \
147 ; RUN:     | FileCheck %s --check-prefix=CHECK-ADAPTORS
148 ; CHECK-ADAPTORS: Running pass: ModuleToFunctionPassAdaptor
149 ; CHECK-ADAPTORS: Running pass: NoOpFunctionPass
150 ; CHECK-ADAPTORS: Running pass: ModuleToFunctionPassAdaptor
151 ; CHECK-ADAPTORS: Running pass: FunctionToLoopPassAdaptor
152 ; CHECK-ADAPTORS: Running pass: NoOpLoopPass on Loop at depth 1 containing: %loop
153 ; CHECK-ADAPTORS: Running pass: ModuleToPostOrderCGSCCPassAdaptor
154 ; CHECK-ADAPTORS: Running pass: NoOpCGSCCPass
155 ; CHECK-ADAPTORS: Running pass: ModuleToPostOrderCGSCCPassAdaptor
156 ; CHECK-ADAPTORS: Running pass: PassManager{{.*}}SCC
157 ; CHECK-ADAPTORS: Running pass: CGSCCToFunctionPassAdaptor
158 ; CHECK-ADAPTORS: Running pass: NoOpFunctionPass
159 ; CHECK-ADAPTORS: Running pass: CGSCCToFunctionPassAdaptor
160 ; CHECK-ADAPTORS: Running pass: FunctionToLoopPassAdaptor
161 ; CHECK-ADAPTORS: Running pass: NoOpLoopPass on Loop at depth 1 containing: %loop
162 ; CHECK-ADAPTORS: Running pass: ModuleToFunctionPassAdaptor
163 ; CHECK-ADAPTORS: Running pass: PassManager{{.*}}Function
164 ; CHECK-ADAPTORS: Running pass: FunctionToLoopPassAdaptor
165 ; CHECK-ADAPTORS: Running pass: NoOpLoopPass on Loop at depth 1 containing: %loop
167 ; RUN: opt -disable-output -debug-pass-manager \
168 ; RUN:     -passes='module(function(no-op-function,loop(no-op-loop,no-op-loop)))' %s 2>&1 \
169 ; RUN:     | FileCheck %s --check-prefix=CHECK-MANAGERS-NO-VERBOSE
170 ; RUN: opt -disable-output -debug-pass-manager=verbose \
171 ; RUN:     -passes='module(function(no-op-function,loop(no-op-loop,no-op-loop)))' %s 2>&1 \
172 ; RUN:     | FileCheck %s --check-prefix=CHECK-MANAGERS
173 ; CHECK-MANAGERS: Running pass: PassManager{{.*}}Function
174 ; CHECK-MANAGERS: Running pass: PassManager{{.*}}Loop
175 ; CHECK-MANAGERS-NO-VERBOSE-NOT: PassManager
177 ; RUN: opt -disable-output -debug-pass-manager \
178 ; RUN:     -passes='cgscc(print)' %s 2>&1 \
179 ; RUN:     | FileCheck %s --check-prefix=CHECK-PRINT-IN-CGSCC
180 ; CHECK-PRINT-IN-CGSCC: Running pass: PrintFunctionPass
181 ; CHECK-PRINT-IN-CGSCC: Running pass: VerifierPass
183 ; RUN: not opt -disable-output -debug-pass-manager \
184 ; RUN:     -passes='function(no-op-function)function(no-op-function)' %s 2>&1 \
185 ; RUN:     | FileCheck %s --check-prefix=CHECK-MISSING-COMMA1
186 ; CHECK-MISSING-COMMA1: invalid pipeline 'function(no-op-function)function(no-op-function)'
188 ; RUN: not opt -disable-output -debug-pass-manager \
189 ; RUN:     -passes='function()' %s 2>&1 \
190 ; RUN:     | FileCheck %s --check-prefix=CHECK-EMPTY-INNER-PIPELINE
191 ; CHECK-EMPTY-INNER-PIPELINE: unknown function pass ''
193 ; RUN: not opt -disable-output -debug-pass-manager \
194 ; RUN:     -passes='no-op-module(no-op-module,whatever)' %s 2>&1 \
195 ; RUN:     | FileCheck %s --check-prefix=CHECK-PIPELINE-ON-MODULE-PASS
196 ; CHECK-PIPELINE-ON-MODULE-PASS: invalid use of 'no-op-module' pass as module pipeline
198 ; RUN: not opt -disable-output -debug-pass-manager \
199 ; RUN:     -passes='no-op-cgscc(no-op-cgscc,whatever)' %s 2>&1 \
200 ; RUN:     | FileCheck %s --check-prefix=CHECK-PIPELINE-ON-CGSCC-PASS
201 ; CHECK-PIPELINE-ON-CGSCC-PASS: invalid use of 'no-op-cgscc' pass as cgscc pipeline
203 ; RUN: not opt -disable-output -debug-pass-manager \
204 ; RUN:     -passes='no-op-function(no-op-function,whatever)' %s 2>&1 \
205 ; RUN:     | FileCheck %s --check-prefix=CHECK-PIPELINE-ON-FUNCTION-PASS
206 ; CHECK-PIPELINE-ON-FUNCTION-PASS: invalid use of 'no-op-function' pass as function pipeline
208 ; RUN: not opt -disable-output -debug-pass-manager \
209 ; RUN:     -passes='no-op-loop(no-op-loop,whatever)' %s 2>&1 \
210 ; RUN:     | FileCheck %s --check-prefix=CHECK-PIPELINE-ON-LOOP-PASS
211 ; CHECK-PIPELINE-ON-LOOP-PASS: invalid use of 'no-op-loop' pass as loop pipeline
213 ; RUN: not opt -disable-output -debug-pass-manager \
214 ; RUN:     -passes='no-op-function()' %s 2>&1 \
215 ; RUN:     | FileCheck %s --check-prefix=CHECK-EMPTY-PIPELINE-ON-PASS
216 ; CHECK-EMPTY-PIPELINE-ON-PASS: invalid use of 'no-op-function' pass as function pipeline
218 ; RUN: not opt -passes='no-op-module,bad' \
219 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-MODULE
220 ; CHECK-UNKNOWN-MODULE: unknown module pass 'bad'
222 ; RUN: not opt -passes='no-op-loop,bad' \
223 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-LOOP
224 ; CHECK-UNKNOWN-LOOP: unknown loop pass 'bad'
226 ; RUN: not opt -passes='no-op-cgscc,bad' \
227 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-CGSCC
228 ; CHECK-UNKNOWN-CGSCC: unknown cgscc pass 'bad'
230 ; RUN: not opt -passes='no-op-function,bad' \
231 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
232 ; RUN: not opt -passes='function(bad,pipeline,text)' \
233 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
234 ; RUN: not opt -passes='module(no-op-module,function(bad,pipeline,text))' \
235 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
236 ; RUN: not opt -passes='no-op-module,function(bad,pipeline,text)' \
237 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
238 ; RUN: not opt -passes='module(cgscc(function(bad,pipeline,text)))' \
239 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
240 ; CHECK-UNKNOWN-FUNCTION: unknown function pass 'bad'
242 ; RUN: not opt -aa-pipeline=bad -passes=no-op-function \
243 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=AA-PIPELINE-ERR
244 ; AA-PIPELINE-ERR: unknown alias analysis name 'bad'
245 ; RUN: opt -passes-ep-peephole=bad -passes=no-op-function \
246 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-PEEPHOLE-ERR
247 ; PASSES-EP-PEEPHOLE-ERR: Could not parse -passes-ep-peephole pipeline: unknown function pass 'bad'
248 ; RUN: opt -passes-ep-late-loop-optimizations=bad -passes=no-op-function \
249 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-LATELOOPOPT-ERR
250 ; PASSES-EP-LATELOOPOPT-ERR: Could not parse -passes-ep-late-loop-optimizations pipeline: unknown loop pass 'bad'
251 ; RUN: opt -passes-ep-loop-optimizer-end=bad -passes=no-op-function \
252 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-LOOPOPTEND-ERR
253 ; PASSES-EP-LOOPOPTEND-ERR: Could not parse -passes-ep-loop-optimizer-end pipeline: unknown loop pass 'bad'
254 ; RUN: opt -passes-ep-scalar-optimizer-late=bad -passes=no-op-function \
255 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-SCALAROPTLATE-ERR
256 ; PASSES-EP-SCALAROPTLATE-ERR: Could not parse -passes-ep-scalar-optimizer-late pipeline: unknown function pass 'bad'
257 ; RUN: opt -passes-ep-cgscc-optimizer-late=bad -passes=no-op-function \
258 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-CGSCCOPTLATE-ERR
259 ; PASSES-EP-CGSCCOPTLATE-ERR: Could not parse -passes-ep-cgscc-optimizer-late pipeline: unknown cgscc pass 'bad'
260 ; RUN: opt -passes-ep-vectorizer-start=bad -passes=no-op-function \
261 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-VECTORIZERSTART-ERR
262 ; PASSES-EP-VECTORIZERSTART-ERR: Could not parse -passes-ep-vectorizer-start pipeline: unknown function pass 'bad'
263 ; RUN: opt -passes-ep-pipeline-start=bad -passes=no-op-function \
264 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-PIPELINESTART-ERR
265 ; PASSES-EP-PIPELINESTART-ERR: Could not parse -passes-ep-pipeline-start pipeline: unknown pass name 'bad'
266 ; RUN: opt -passes-ep-pipeline-early-simplification=bad -passes=no-op-function \
267 ; RUN:       /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-PIPELINEEARLYSIMPLIFICATION-ERR
268 ; PASSES-EP-PIPELINEEARLYSIMPLIFICATION-ERR: Could not parse -passes-ep-pipeline-early-simplification pipeline: unknown pass name 'bad'
270 define void @f() {
271 entry:
272  br label %loop
273 loop:
274  br label %loop