Clang Project

clang_source_code/test/CodeGen/emit-summary-index.c
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
12//
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
16
17int main() {}
18