From a2fe1fe208499acff9a9d1ea1a1ceed1056acf2b Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 12 Oct 2009 21:21:22 +0000 Subject: Yet another test for explicit specialization, this one involving linkage llvm-svn: 83901 --- .../test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp (limited to 'clang') diff --git a/clang/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp new file mode 100644 index 00000000000..a5d5b9e3c41 --- /dev/null +++ b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp @@ -0,0 +1,42 @@ +// RUN: clang-cc -emit-llvm -o - %s | FileCheck %s + +template void f(T) { /* ... */ } +template inline void g(T) { /* ... */ } + +// CHECK: define void @_Z1gIiEvT_ +template<> void g<>(int) { /* ... */ } + +template +struct X { + void f() { } + void g(); + void h(); +}; + +template +void X::g() { +} + +template +inline void X::h() { +} + +// CHECK: define void @_ZN1XIiE1fEv +template<> void X::f() { } + +// CHECK: define void @_ZN1XIiE1hEv +template<> void X::h() { } + +// CHECK: define linkonce_odr void @_Z1fIiEvT_ +template<> inline void f<>(int) { /* ... */ } + +// CHECK: define linkonce_odr void @_ZN1XIiE1gEv +template<> inline void X::g() { } + +void test(X xi) { + f(17); + g(17); + xi.f(); + xi.g(); + xi.h(); +} -- cgit v1.2.3