2010-06-23 21:48:30 +08:00
|
|
|
// Test this without pch.
|
2010-08-11 03:33:56 +08:00
|
|
|
// RUN: %clang_cc1 -include %S/cxx-templates.h -verify %s -ast-dump -o -
|
2010-08-04 01:30:10 +08:00
|
|
|
// RUN: %clang_cc1 -include %S/cxx-templates.h %s -emit-llvm -o - | FileCheck %s
|
2010-06-20 03:28:53 +08:00
|
|
|
|
2010-06-23 21:48:30 +08:00
|
|
|
// Test with pch.
|
|
|
|
// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-templates.h
|
2010-08-11 03:33:56 +08:00
|
|
|
// RUN: %clang_cc1 -include-pch %t -verify %s -ast-dump -o -
|
2010-08-04 01:30:10 +08:00
|
|
|
// RUN: %clang_cc1 -include-pch %t %s -emit-llvm -o - | FileCheck %s
|
|
|
|
|
2010-08-05 17:48:16 +08:00
|
|
|
// CHECK: define weak_odr void @_ZN2S4IiE1mEv
|
2010-08-04 01:30:10 +08:00
|
|
|
// CHECK: define linkonce_odr void @_ZN2S3IiE1mEv
|
2010-06-24 16:57:31 +08:00
|
|
|
|
|
|
|
struct A {
|
|
|
|
typedef int type;
|
|
|
|
static void my_f();
|
|
|
|
template <typename T>
|
|
|
|
static T my_templf(T x) { return x; }
|
|
|
|
};
|
2010-06-22 17:55:07 +08:00
|
|
|
|
|
|
|
void test() {
|
2010-06-26 00:25:09 +08:00
|
|
|
int x = templ_f<int, 5>(3);
|
2010-06-23 21:48:30 +08:00
|
|
|
|
|
|
|
S<char, float>::templ();
|
|
|
|
S<int, char>::partial();
|
|
|
|
S<int, float>::explicit_special();
|
2010-06-24 16:57:31 +08:00
|
|
|
|
|
|
|
Dep<A>::Ty ty;
|
|
|
|
Dep<A> a;
|
|
|
|
a.f();
|
2010-08-04 01:30:10 +08:00
|
|
|
|
|
|
|
S3<int> s3;
|
|
|
|
s3.m();
|
2010-09-07 03:04:27 +08:00
|
|
|
|
|
|
|
TS5 ts(0);
|
2010-06-22 17:55:07 +08:00
|
|
|
}
|
2010-08-05 17:48:16 +08:00
|
|
|
|
|
|
|
template struct S4<int>;
|