1 // RUN: %clang_cc1 %s -emit-llvm -o - -ftime-report 2>&1 | FileCheck %s
2 // RUN: %clang_cc1 %s -emit-llvm -o - -fdelayed-template-parsing -DDELAYED_TEMPLATE_PARSING -ftime-report 2>&1 | FileCheck %s
4 // Template function declarations
7 template <typename T
, typename U
>
10 // Template function definitions.
14 // Template class (forward) declarations
17 template <typename T
, typename U
>
21 template <typename
, typename
>
24 // Forward declarations with default parameters?
25 template <typename T
= int>
27 template <typename
= int>
30 // Forward declarations w/template template parameters
31 template <template <typename
> class T
>
33 template <template <typename
> class>
35 template <template <typename X
, typename Y
> class T
>
38 // Forward declarations with non-type params
47 template <unsigned int N
= 12u>
49 template <unsigned int = 12u>
51 template <unsigned = 15u>
53 template <typename T
, T Obj
>
56 // Template class declarations
59 template <typename T
, typename U
>
65 void bar(typename
T::x
);
69 void N::bar(typename
T::x
) {}
72 // This PR occurred only in template parsing mode.
86 void L
<k
>::O
<T
>::Fun(U
) {}
88 void Instantiate() { L
<0>::O
<int>::Fun(0); }
91 namespace explicit_partial_specializations
{
92 typedef char (&oneT
)[1];
93 typedef char (&twoT
)[2];
94 typedef char (&threeT
)[3];
95 typedef char (&fourT
)[4];
96 typedef char (&fiveT
)[5];
97 typedef char (&sixT
)[6];
107 struct bool_
{ typedef int type
; };
109 struct bool_
<false> {};
111 #define XCAT(x, y) x##y
112 #define CAT(x, y) XCAT(x, y)
113 #define sassert(_b_) bool_<(_b_)>::type CAT(var, __LINE__);
117 template <typename T
>
119 template <typename U
>
124 template <typename T
>
125 template <typename U
>
126 oneT L
<k
>::O
<T
>::Fun(U
) { return one
; }
130 template <typename U
>
131 oneT L
<0>::O
<char>::Fun(U
) { return one
; }
134 sassert(sizeof(L
<0>::O
<int>::Fun(0)) == sizeof(one
));
135 sassert(sizeof(L
<0>::O
<char>::Fun(0)) == sizeof(one
));
141 template <class _Other
>
142 using rebind_alloc
= _Other
;
144 template <class _Alloc
>
146 template <class _Other
>
147 using rebind_alloc
= typename Foo
<_Alloc
>::template rebind_alloc
<_Other
>;
149 using rebind
= _Wrap_alloc
;
151 _Wrap_alloc
<int>::rebind
<int> w
;
153 // CHECK: Miscellaneous Ungrouped Timers
154 // CHECK-DAG: LLVM IR Generation Time
155 // CHECK-DAG: Code Generation Time
157 // CHECK: Clang front-end time report
158 // CHECK: Clang front-end timer