diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-04-15 01:08:06 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-04-15 01:08:06 +0000 |
commit | e07140eb3fb5b2d3df2f57cccc633a0d1e21c6f2 (patch) | |
tree | 7ae34ebf92346ca97b9df63beff0cac6f606dd98 /clang/test/CodeGenCXX/auto-variable-template.cpp | |
parent | 58927f1aa2e37854b5ff728eedda8ec8aff779be (diff) | |
download | bcm5719-llvm-e07140eb3fb5b2d3df2f57cccc633a0d1e21c6f2.tar.gz bcm5719-llvm-e07140eb3fb5b2d3df2f57cccc633a0d1e21c6f2.zip |
Move the logic to avoid double global emission from Sema to CodeGen
Reverts the code changes from r234675 but keeps the test case.
We were already maintaining a DenseMap of globals with dynamic
initializers anyway.
Fixes the test case from PR23234.
llvm-svn: 234961
Diffstat (limited to 'clang/test/CodeGenCXX/auto-variable-template.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/auto-variable-template.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/auto-variable-template.cpp b/clang/test/CodeGenCXX/auto-variable-template.cpp new file mode 100644 index 00000000000..265d81dd352 --- /dev/null +++ b/clang/test/CodeGenCXX/auto-variable-template.cpp @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -std=c++14 %s -triple=x86_64-linux -emit-llvm -o - | FileCheck %s + +struct f { + void operator()() const {} +}; + +template <typename T> auto vtemplate = f{}; + +int main() { vtemplate<int>(); } + +// CHECK: @_Z9vtemplateIiE = linkonce_odr global %struct.f undef, comdat + +// CHECK: define i32 @main() +// CHECK: call void @_ZNK1fclEv(%struct.f* @_Z9vtemplateIiE) |