summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/emit-summary-index.c
diff options
context:
space:
mode:
authorTobias Edler von Koch <tobias@codeaurora.org>2018-06-22 20:23:21 +0000
committerTobias Edler von Koch <tobias@codeaurora.org>2018-06-22 20:23:21 +0000
commit7609cb83e69029a32e8ff94d165ab7315695a356 (patch)
treed64a2d82d5c39d85049936c45691bd12b9f1953e /clang/test/CodeGen/emit-summary-index.c
parent9bc2c059c3796813995e662d4418e1abfa2f5d73 (diff)
downloadbcm5719-llvm-7609cb83e69029a32e8ff94d165ab7315695a356.tar.gz
bcm5719-llvm-7609cb83e69029a32e8ff94d165ab7315695a356.zip
Re-land "[LTO] Enable module summary emission by default for regular LTO"
Since we are now producing a summary also for regular LTO builds, we need to run the NameAnonGlobals pass in those cases as well (the summary cannot handle anonymous globals). See https://reviews.llvm.org/D34156 for details on the original change. This reverts commit 6c9ee4a4a438a8059aacc809b2dd57128fccd6b3. llvm-svn: 335385
Diffstat (limited to 'clang/test/CodeGen/emit-summary-index.c')
-rw-r--r--clang/test/CodeGen/emit-summary-index.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGen/emit-summary-index.c b/clang/test/CodeGen/emit-summary-index.c
new file mode 100644
index 00000000000..61264102068
--- /dev/null
+++ b/clang/test/CodeGen/emit-summary-index.c
@@ -0,0 +1,17 @@
+// ; Check that the -flto=thin option emits a ThinLTO summary
+// RUN: %clang_cc1 -flto=thin -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck %s
+// CHECK: <GLOBALVAL_SUMMARY_BLOCK
+//
+// ; Check that we do not emit a summary for regular LTO on Apple platforms
+// RUN: %clang_cc1 -flto -triple x86_64-apple-darwin -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck --check-prefix=LTO %s
+// LTO-NOT: GLOBALVAL_SUMMARY_BLOCK
+//
+// ; Check that we emit a summary for regular LTO by default elsewhere
+// RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck --check-prefix=LTOINDEX %s
+// LTOINDEX: <FULL_LTO_GLOBALVAL_SUMMARY_BLOCK
+//
+// ; Simulate -save-temps and check that it works (!"ThinLTO" module flag not added multiple times)
+// RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc -disable-llvm-passes < %s -o %t.bc
+// 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
+
+int main() {}
OpenPOWER on IntegriCloud