[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / emit-summary-index.c
blob4a18831c89547469e3f8ac1e10464a1f8ff06612
1 // ; Check that the -flto=thin option emits a ThinLTO summary
2 // RUN: %clang_cc1 -flto=thin -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck %s
3 // CHECK: <GLOBALVAL_SUMMARY_BLOCK
4 //
5 // ; Check that we do not emit a summary for regular LTO on Apple platforms
6 // RUN: %clang_cc1 -flto -triple x86_64-apple-darwin -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck --check-prefix=LTO %s
7 // LTO-NOT: GLOBALVAL_SUMMARY_BLOCK
8 //
9 // ; Check that we emit a summary for regular LTO by default elsewhere
10 // RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck --check-prefix=LTOINDEX %s
11 // LTOINDEX: <FULL_LTO_GLOBALVAL_SUMMARY_BLOCK
13 // ; Simulate -save-temps and check that it works (!"ThinLTO" module flag not added multiple times)
14 // RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc -disable-llvm-passes < %s -o %t.bc
15 // RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc -x ir < %t.bc | llvm-bcanalyzer -dump | FileCheck --check-prefix=LTOINDEX %s
17 /// Check that emitting bitcode works for Unified LTO, when either LTO mode is specified
18 // RUN: %clang_cc1 -flto=thin -funified-lto -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck --check-prefix=UNITHIN %s
19 // RUN: %clang_cc1 -flto -funified-lto -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck --check-prefix=UNITHIN %s
21 // UNITHIN: <GLOBALVAL_SUMMARY_BLOCK
23 int main(void) {}