summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/auto-variable-template.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-04-15 01:08:06 +0000
committerReid Kleckner <reid@kleckner.net>2015-04-15 01:08:06 +0000
commite07140eb3fb5b2d3df2f57cccc633a0d1e21c6f2 (patch)
tree7ae34ebf92346ca97b9df63beff0cac6f606dd98 /clang/test/CodeGenCXX/auto-variable-template.cpp
parent58927f1aa2e37854b5ff728eedda8ec8aff779be (diff)
downloadbcm5719-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.cpp14
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)
OpenPOWER on IntegriCloud