Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s |
Anders Carlsson | 548e60e | 2009-12-10 22:25:34 +0000 | [diff] [blame] | 2 | template<typename T> struct A { |
| 3 | virtual void f(T) { } |
| 4 | inline void g() { } |
| 5 | }; |
| 6 | |
| 7 | // Explicit instantiations have external linkage. |
| 8 | |
Douglas Gregor | 8f51a4f | 2010-03-13 18:23:07 +0000 | [diff] [blame] | 9 | // CHECK: define weak_odr void @_ZN1AIiE1gEv( |
Anders Carlsson | 548e60e | 2009-12-10 22:25:34 +0000 | [diff] [blame] | 10 | template void A<int>::g(); |
| 11 | |
Douglas Gregor | 8f51a4f | 2010-03-13 18:23:07 +0000 | [diff] [blame] | 12 | // CHECK: define weak_odr void @_ZN1AIfE1fEf( |
| 13 | // CHECK: define weak_odr void @_ZN1AIfE1gEv( |
Anders Carlsson | 548e60e | 2009-12-10 22:25:34 +0000 | [diff] [blame] | 14 | // FIXME: This should also emit the vtable. |
| 15 | template struct A<float>; |
| 16 | |
Douglas Gregor | 8f51a4f | 2010-03-13 18:23:07 +0000 | [diff] [blame] | 17 | // CHECK: define weak_odr void @_Z1fIiEvT_ |
Anders Carlsson | 548e60e | 2009-12-10 22:25:34 +0000 | [diff] [blame] | 18 | template <typename T> void f(T) { } |
| 19 | template void f<int>(int); |
| 20 | |
Douglas Gregor | 8f51a4f | 2010-03-13 18:23:07 +0000 | [diff] [blame] | 21 | // CHECK: define weak_odr void @_Z1gIiEvT_ |
Anders Carlsson | 548e60e | 2009-12-10 22:25:34 +0000 | [diff] [blame] | 22 | template <typename T> inline void g(T) { } |
| 23 | template void g<int>(int); |
| 24 | |