aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/vtable-linkage.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-11 03:25:57 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-11 03:25:57 +0000
commitd2c47bde3bc0c0debd8a9728781d3375efe22bc5 (patch)
treee1c731812888f1f798ab863f82a5d1f107a6aea1 /test/CodeGenCXX/vtable-linkage.cpp
parent6d576051b9ca56fe962077fb194ed2917539989a (diff)
Make sure the VTables for template instantiations are emitted even if the key function doesn't have a body.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-linkage.cpp')
-rw-r--r--test/CodeGenCXX/vtable-linkage.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-linkage.cpp b/test/CodeGenCXX/vtable-linkage.cpp
index cf988d1312..265126882a 100644
--- a/test/CodeGenCXX/vtable-linkage.cpp
+++ b/test/CodeGenCXX/vtable-linkage.cpp
@@ -197,3 +197,18 @@ void G<int>::f1() {}
template <typename T>
void G<T>::f0() {}
void G_f0() { new G<int>(); }
+
+// RUN: FileCheck --check-prefix=CHECK-H %s < %t
+
+// H<int> has a key function without a body but it's a template instantiation
+// so its VTable must be emmitted.
+// CHECK-H: @_ZTV1HIiE = weak_odr constant
+template <typename T>
+class H {
+public:
+ virtual ~H();
+};
+
+void use_H() {
+ H<int> h;
+}