aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/vtable-linkage.cpp
diff options
context:
space:
mode:
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;
+}