Rafael Espindola | b0f65ca | 2010-03-22 23:12:48 +0000 | [diff] [blame] | 1 | // 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 | |
| 6 | namespace 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 | |
| 22 | namespace 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 | } |