1 // REQUIRES: x86-registered-target
2
3 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -O0 %s 2>&1 | FileCheck %s \
4 // RUN: -check-prefix=CHECK-FULL-O0
5 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -O0 %s 2>&1 | FileCheck %s \
6 // RUN: -check-prefix=CHECK-THIN-O0
7 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -O1 %s 2>&1 | FileCheck %s \
8 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
9 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -O1 %s 2>&1 | FileCheck %s \
10 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
11 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -O2 %s 2>&1 | FileCheck %s \
12 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
13 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -O2 %s 2>&1 | FileCheck %s \
14 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
15 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -O3 %s 2>&1 | FileCheck %s \
16 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
17 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -O3 %s 2>&1 | FileCheck %s \
18 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
19 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -Os %s 2>&1 | FileCheck %s \
20 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
21 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -Os %s 2>&1 | FileCheck %s \
22 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
23 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -Oz %s 2>&1 | FileCheck %s \
24 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
25 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -Oz %s 2>&1 | FileCheck %s \
26 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
27
28 // CHECK-FULL-O0: Starting llvm::Module pass manager run.
29 // CHECK-FULL-O0: Running pass: AlwaysInlinerPass
30 // CHECK-FULL-O0-NEXT: Running analysis: InnerAnalysisManagerProxy
31 // CHECK-FULL-O0-NEXT: Running analysis: ProfileSummaryAnalysis
32 // CHECK-FULL-O0-NEXT: Running pass: CanonicalizeAliasesPass
33 // CHECK-FULL-O0-NEXT: Running pass: NameAnonGlobalPass
34 // CHECK-FULL-O0-NEXT: Running pass: BitcodeWriterPass
35 // CHECK-FULL-O0: Finished llvm::Module pass manager run.
36
37 // CHECK-THIN-O0: Starting llvm::Module pass manager run.
38 // CHECK-THIN-O0: Running pass: AlwaysInlinerPass
39 // CHECK-THIN-O0-NEXT: Running analysis: InnerAnalysisManagerProxy
40 // CHECK-THIN-O0-NEXT: Running analysis: ProfileSummaryAnalysis
41 // CHECK-THIN-O0-NEXT: Running pass: CanonicalizeAliasesPass
42 // CHECK-THIN-O0-NEXT: Running pass: NameAnonGlobalPass
43 // CHECK-THIN-O0-NEXT: Running pass: ThinLTOBitcodeWriterPass
44 // CHECK-THIN-O0: Finished llvm::Module pass manager run.
45
46 // TODO: The LTO pre-link pipeline currently invokes
47 // buildPerModuleDefaultPipeline(), which contains LoopVectorizePass.
48 // This may change as the pipeline gets implemented.
49 // CHECK-FULL-OPTIMIZED: Starting llvm::Function pass manager run.
50 // CHECK-FULL-OPTIMIZED: Running pass: LoopVectorizePass
51 // CHECK-FULL-OPTIMIZED: Running pass: BitcodeWriterPass
52
53 // The ThinLTO pre-link pipeline shouldn't contain passes like
54 // LoopVectorizePass.
55 // CHECK-THIN-OPTIMIZED: Starting llvm::Function pass manager run.
56 // CHECK-THIN-OPTIMIZED-NOT: Running pass: LoopVectorizePass
57 // CHECK-THIN-OPTIMIZED: Running pass: CanonicalizeAliasesPass
58 // CHECK-THIN-OPTIMIZED: Running pass: NameAnonGlobalPass
59 // CHECK-THIN-OPTIMIZED: Running pass: ThinLTOBitcodeWriterPass
60
Foo()61 void Foo() {}
62