[analyzer] Refactoring: Drop the 'GR' prefix.
[clang.git] / test / CodeGenCXX / template-linkage.cpp
blob63a5c09cd7d8d5b794652acb2c81408a2a22fa0d
1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
2 template<typename T> struct A {
3 virtual void f(T) { }
4 inline void g() { }
5 };
7 // Explicit instantiations have external linkage.
9 // CHECK: define weak_odr void @_ZN1AIiE1gEv(
10 template void A<int>::g();
12 // CHECK: define weak_odr void @_ZN1AIfE1fEf(
13 // CHECK: define weak_odr void @_ZN1AIfE1gEv(
14 // FIXME: This should also emit the vtable.
15 template struct A<float>;
17 // CHECK: define weak_odr void @_Z1fIiEvT_
18 template <typename T> void f(T) { }
19 template void f<int>(int);
21 // CHECK: define weak_odr void @_Z1gIiEvT_
22 template <typename T> inline void g(T) { }
23 template void g<int>(int);
25 template<typename T>
26 struct X0 {
27 virtual ~X0() { }
30 template<typename T>
31 struct X1 : X0<T> {
32 virtual void blarg();
35 template<typename T> void X1<T>::blarg() { }
37 extern template struct X0<char>;
38 extern template struct X1<char>;
40 // CHECK: define linkonce_odr void @_ZN2X1IcED1Ev(
41 void test_X1() {
42 X1<char> i1c;