Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s |
Eli Friedman | 378fe06 | 2009-12-05 04:55:55 +0000 | [diff] [blame] | 2 | |
| 3 | template<class T> class A { |
John McCall | 7002f4c | 2010-04-09 19:03:51 +0000 | [diff] [blame] | 4 | public: |
Eli Friedman | 378fe06 | 2009-12-05 04:55:55 +0000 | [diff] [blame] | 5 | A() {} |
| 6 | virtual void a() {} |
| 7 | }; |
| 8 | class B : A<int> { |
| 9 | B(); |
| 10 | }; |
| 11 | B::B() {} |
| 12 | |
John McCall | 3d640e6 | 2010-08-03 07:24:12 +0000 | [diff] [blame] | 13 | template class A<long>; |
| 14 | |
| 15 | extern template class A<short>; |
| 16 | template class A<short>; |
| 17 | |
| 18 | |
Anders Carlsson | f502d93 | 2011-01-24 00:46:19 +0000 | [diff] [blame] | 19 | // CHECK: @_ZTV1B = linkonce_odr unnamed_addr constant |
Rafael Espindola | 9f959db | 2011-01-11 21:10:26 +0000 | [diff] [blame] | 20 | // CHECK: @_ZTV1AIlE = weak_odr unnamed_addr constant |
| 21 | // CHECK: @_ZTV1AIsE = weak_odr unnamed_addr constant |
Anders Carlsson | f502d93 | 2011-01-24 00:46:19 +0000 | [diff] [blame] | 22 | // CHECK: @_ZTV1AIiE = linkonce_odr unnamed_addr constant |
Richard Smith | ff817f7 | 2012-07-07 06:59:51 +0000 | [diff] [blame] | 23 | |
| 24 | template<class T> struct C { |
| 25 | virtual void c() {} |
| 26 | }; |
| 27 | struct D : C<int> { |
| 28 | virtual void d(); |
| 29 | }; |
| 30 | void D::d() {} |
| 31 | |
| 32 | // CHECK: define {{.*}}@_ZN1CIiE1cEv( |