1 // RUN: %clang_cc1 -emit-llvm -triple i686-pc-linux-gnu -o - %s | FileCheck %s
3 // This check logically is attached to 'template int S<int>::i;' below.
4 // CHECK: @_ZN1SIiE1iE = weak global i32
6 template<typename T
, typename U
, typename Result
>
8 Result
operator()(const T
& t
, const U
& u
) const;
11 template<typename T
, typename U
, typename Result
>
12 Result plus
<T
, U
, Result
>::operator()(const T
& t
, const U
& u
) const {
16 // CHECK: define weak_odr i32 @_ZNK4plusIillEclERKiRKl
17 template struct plus
<int, long, long>;
19 // Check that we emit definitions from explicit instantiations even when they
20 // occur prior to the definition itself.
21 template <typename T
> struct S
{
30 // CHECK: define weak_odr void @_ZN1SIiE1fEv
31 template void S
<int>::f();
33 // CHECK: define weak_odr void @_ZN1SIiE1gEv
34 template void S
<int>::g();
36 // See the check line at the top of the file.
37 template int S
<int>::i
;
39 // CHECK: define weak_odr void @_ZN1SIiE2S21hEv
40 template void S
<int>::S2::h();
42 template <typename T
> void S
<T
>::f() {}
43 template <typename T
> void S
<T
>::g() {}
44 template <typename T
> int S
<T
>::i
;
45 template <typename T
> void S
<T
>::S2::h() {}