summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp3
-rw-r--r--llvm/test/Bitcode/thinlto-summary-globalvar.ll5
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 20cbc2bf4b6..971d21ecc2f 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -3271,9 +3271,6 @@ static const uint64_t INDEX_VERSION = 1;
/// Emit the per-module summary section alongside the rest of
/// the module's bitcode.
void ModuleBitcodeWriter::writePerModuleGlobalValueSummary() {
- if (M.empty())
- return;
-
if (Index->begin() == Index->end())
return;
diff --git a/llvm/test/Bitcode/thinlto-summary-globalvar.ll b/llvm/test/Bitcode/thinlto-summary-globalvar.ll
new file mode 100644
index 00000000000..56f9c078875
--- /dev/null
+++ b/llvm/test/Bitcode/thinlto-summary-globalvar.ll
@@ -0,0 +1,5 @@
+; RUN: opt -module-summary %s -o - | llvm-bcanalyzer -dump | FileCheck %s
+
+; CHECK: <GLOBALVAL_SUMMARY_BLOCK
+
+@a = global i32 0
OpenPOWER on IntegriCloud