summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/auto-variable-template.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/auto-variable-template.cpp')
-rw-r--r--test/CodeGenCXX/auto-variable-template.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenCXX/auto-variable-template.cpp b/test/CodeGenCXX/auto-variable-template.cpp
new file mode 100644
index 0000000000000..265d81dd352a6
--- /dev/null
+++ b/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)