xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/virt-template-vtable.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc template<class T> class A {
4*f4a2713aSLionel Sambuc public:
5*f4a2713aSLionel Sambuc   A() {}
6*f4a2713aSLionel Sambuc   virtual void a() {}
7*f4a2713aSLionel Sambuc };
8*f4a2713aSLionel Sambuc class B : A<int> {
9*f4a2713aSLionel Sambuc   B();
10*f4a2713aSLionel Sambuc };
11*f4a2713aSLionel Sambuc B::B() {}
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc template class A<long>;
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc extern template class A<short>;
16*f4a2713aSLionel Sambuc template class A<short>;
17*f4a2713aSLionel Sambuc 
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc // CHECK: @_ZTV1B = linkonce_odr unnamed_addr constant
20*f4a2713aSLionel Sambuc // CHECK: @_ZTV1AIlE = weak_odr unnamed_addr constant
21*f4a2713aSLionel Sambuc // CHECK: @_ZTV1AIsE = weak_odr unnamed_addr constant
22*f4a2713aSLionel Sambuc // CHECK: @_ZTV1AIiE = linkonce_odr unnamed_addr constant
23*f4a2713aSLionel Sambuc 
24*f4a2713aSLionel Sambuc template<class T> struct C {
25*f4a2713aSLionel Sambuc   virtual void c() {}
26*f4a2713aSLionel Sambuc };
27*f4a2713aSLionel Sambuc struct D : C<int> {
28*f4a2713aSLionel Sambuc   virtual void d();
29*f4a2713aSLionel Sambuc };
30*f4a2713aSLionel Sambuc void D::d() {}
31*f4a2713aSLionel Sambuc 
32*f4a2713aSLionel Sambuc // CHECK: define {{.*}}@_ZN1CIiE1cEv(
33