| 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s |
| 2 | |
| 3 | template<class T> void f(T) { /* ... */ } |
| 4 | template<class T> inline void g(T) { /* ... */ } |
| 5 | |
| 6 | // CHECK: define void @_Z1gIiEvT_ |
| 7 | template<> void g<>(int) { /* ... */ } |
| 8 | |
| 9 | template<class T> |
| 10 | struct X { |
| 11 | void f() { } |
| 12 | void g(); |
| 13 | void h(); |
| 14 | }; |
| 15 | |
| 16 | template<class T> |
| 17 | void X<T>::g() { |
| 18 | } |
| 19 | |
| 20 | template<class T> |
| 21 | inline void X<T>::h() { |
| 22 | } |
| 23 | |
| 24 | // CHECK: define void @_ZN1XIiE1fEv |
| 25 | template<> void X<int>::f() { } |
| 26 | |
| 27 | // CHECK: define void @_ZN1XIiE1hEv |
| 28 | template<> void X<int>::h() { } |
| 29 | |
| 30 | // CHECK: define linkonce_odr void @_Z1fIiEvT_ |
| 31 | template<> inline void f<>(int) { /* ... */ } |
| 32 | |
| 33 | // CHECK: define linkonce_odr void @_ZN1XIiE1gEv |
| 34 | template<> inline void X<int>::g() { } |
| 35 | |
| 36 | void test(X<int> xi) { |
| 37 | f(17); |
| 38 | g(17); |
| 39 | xi.f(); |
| 40 | xi.g(); |
| 41 | xi.h(); |
| 42 | } |
| 43 | |