blob: 8d168f110608039b1429f0bc23a32692d6415943 [file] [log] [blame]
Rafael Espindolab0f65ca2010-03-22 23:12:48 +00001// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
2
3// CHECK-NOT: @_ZTVN5test118stdio_sync_filebufIwEE = constant
4// CHECK: @_ZTVN5test018stdio_sync_filebufIwEE = constant
5
6namespace test0 {
7 struct basic_streambuf {
8 virtual ~basic_streambuf();
9 };
10 template<typename _CharT >
11 struct stdio_sync_filebuf : public basic_streambuf {
12 virtual void xsgetn();
13 };
14
15 // This specialization should cause the vtable to be emitted, even with
16 // the following extern template declaration.
17 template<> void stdio_sync_filebuf<wchar_t>::xsgetn() {
18 }
19 extern template class stdio_sync_filebuf<wchar_t>;
20}
21
22namespace test1 {
23 struct basic_streambuf {
24 virtual ~basic_streambuf();
25 };
26 template<typename _CharT >
27 struct stdio_sync_filebuf : public basic_streambuf {
28 virtual void xsgetn();
29 };
30
31 // Just a declaration should not force the vtable to be emitted.
32 template<> void stdio_sync_filebuf<wchar_t>::xsgetn();
33}