summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/template-instantiation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/template-instantiation.cpp')
-rw-r--r--test/CodeGenCXX/template-instantiation.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/test/CodeGenCXX/template-instantiation.cpp b/test/CodeGenCXX/template-instantiation.cpp
index 80283a1..90b8099 100644
--- a/test/CodeGenCXX/template-instantiation.cpp
+++ b/test/CodeGenCXX/template-instantiation.cpp
@@ -5,10 +5,14 @@
//
// CHECK-NOT: @_ZTVN5test118stdio_sync_filebufIwEE = constant
// CHECK-NOT: _ZTVN5test315basic_fstreamXXIcEE
-// CHECK: @_ZTVN5test018stdio_sync_filebufIwEE = unnamed_addr constant
+// CHECK-NOT: @_ZTVN5test018stdio_sync_filebufIA1_iEE
+// CHECK-NOT: @_ZTVN5test018stdio_sync_filebufIA2_iEE
+// CHECK: @_ZTVN5test018stdio_sync_filebufIA3_iEE = weak_odr unnamed_addr constant
-// CHECK: @_ZN7PR100011SIiE3arrE = weak_odr global [3 x i32]
-// CHECK-NOT: @_ZN7PR100011SIiE3arr2E = weak_odr global [3 x i32]A
+// CHECK: @_ZN7PR100011SIiE3arrE = linkonce_odr global [3 x i32]
+// CHECK-NOT: @_ZN7PR100011SIiE3arr2E = linkonce_odr global [3 x i32]A
+
+// CHECK: @_ZTVN5test018stdio_sync_filebufIA4_iEE = linkonce_odr unnamed_addr constant
// CHECK-NOT: _ZTVN5test31SIiEE
// CHECK-NOT: _ZTSN5test31SIiEE
@@ -39,11 +43,21 @@ namespace test0 {
virtual void xsgetn();
};
- // This specialization should cause the vtable to be emitted, even with
- // the following extern template declaration.
- template<> void stdio_sync_filebuf<wchar_t>::xsgetn() {
+ // This specialization is not a key function, so doesn't cause the vtable to
+ // be instantiated unless we're instantiating a class definition anyway.
+ template<> void stdio_sync_filebuf<int[1]>::xsgetn() {
+ }
+ template<> void stdio_sync_filebuf<int[2]>::xsgetn() {
+ }
+ template<> void stdio_sync_filebuf<int[3]>::xsgetn() {
}
- extern template class stdio_sync_filebuf<wchar_t>;
+ template<> void stdio_sync_filebuf<int[4]>::xsgetn() {
+ }
+ extern template class stdio_sync_filebuf<int[2]>;
+
+ // These two both cause vtables to be emitted.
+ template class stdio_sync_filebuf<int[3]>;
+ stdio_sync_filebuf<int[4]> implicit_instantiation;
}
namespace test1 {
OpenPOWER on IntegriCloud