1// RUN: tco %s | FileCheck %s
2// RUN: tco %s --mlir-pass-statistics --mlir-pass-statistics-display=pipeline 2>&1 | FileCheck %s --check-prefix=PASSES
3
4// REQUIRES: asserts
5
6// Check that tco is working with a basic test.
7// Also check the passes in the default pipeline.
8
9func.func @_QQmain() {
10  return
11}
12
13// CHECK: ; ModuleID = 'FIRModule'
14// CHECK-LABEL: define void @_QQmain()
15// CHECK:       ret void
16
17// PASSES: Pass statistics report
18
19// PASSES:      CSE
20// PASSES-NEXT:   (S) 0 num-cse'd - Number of operations CSE'd
21// PASSES-NEXT:   (S) 0 num-dce'd - Number of operations DCE'd
22
23// PASSES-NEXT: 'func.func' Pipeline
24// PASSES-NEXT:   ArrayValueCopy
25// PASSES-NEXT:   CharacterConversion
26
27// PASSES-NEXT: Canonicalizer
28// PASSES-NEXT: SimplifyRegionLite
29// PASSES-NEXT: AlgebraicSimplification
30// PASSES-NEXT: CSE
31// PASSES-NEXT:   (S) 0 num-cse'd - Number of operations CSE'd
32// PASSES-NEXT:   (S) 0 num-dce'd - Number of operations DCE'd
33
34// PASSES-NEXT: 'func.func' Pipeline
35// PASSES-NEXT:   MemoryAllocationOpt
36
37// PASSES-NEXT: Inliner
38// PASSES-NEXT: SimplifyRegionLite
39// PASSES-NEXT: CSE
40// PASSES-NEXT:   (S) 0 num-cse'd - Number of operations CSE'd
41// PASSES-NEXT:   (S) 0 num-dce'd - Number of operations DCE'd
42
43// PASSES-NEXT: 'func.func' Pipeline
44// PASSES-NEXT:   CFGConversion
45
46// PASSES-NEXT: SCFToControlFlow
47// PASSES-NEXT: Canonicalizer
48// PASSES-NEXT: SimplifyRegionLite
49// PASSES-NEXT: CSE
50// PASSES-NEXT:   (S) 0 num-cse'd - Number of operations CSE'd
51// PASSES-NEXT:   (S) 0 num-dce'd - Number of operations DCE'd
52// PASSES-NEXT: BoxedProcedurePass
53
54// PASSES-NEXT: 'func.func' Pipeline
55// PASSES-NEXT:   AbstractResultOpt
56
57// PASSES-NEXT: CodeGenRewrite
58// PASSES-NEXT:   (S) 0 num-dce'd - Number of operations eliminated
59// PASSES-NEXT: TargetRewrite
60// PASSES-NEXT: FIRToLLVMLowering
61// PASSES-NEXT: LLVMIRLoweringPass
62