diff options
author | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | c86b984ea8ecb3e944dc3de48539f4c1f65851ea (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /test/CodeGenCXX/function-template-specialization.cpp | |
parent | c696171ff15f0ee60dea4abfd99a135473c95656 (diff) | |
download | FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.zip FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.tar.gz |
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102
Diffstat (limited to 'test/CodeGenCXX/function-template-specialization.cpp')
-rw-r--r-- | test/CodeGenCXX/function-template-specialization.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGenCXX/function-template-specialization.cpp b/test/CodeGenCXX/function-template-specialization.cpp index eb099df..7728f3d 100644 --- a/test/CodeGenCXX/function-template-specialization.cpp +++ b/test/CodeGenCXX/function-template-specialization.cpp @@ -1,4 +1,8 @@ // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - | FileCheck %s + +// CHECK-DAG: _ZZN7PR219047GetDataIiEERKibE1i = internal global i32 4 +// CHECK-DAG: _ZZN7PR219047GetDataIiEERKibE1i_0 = internal global i32 2 + template<typename T, typename U> T* next(T* ptr, const U& diff); @@ -24,3 +28,18 @@ void test2(int *iptr, double *dptr, int diff) { // CHECK: _Z4nextIdiEPT_S1_RKT0_ dptr = next(dptr, diff); } + +namespace PR21904 { +template <typename> +const int &GetData(bool); + +template <> +const int &GetData<int>(bool b) { + static int i = 4; + if (b) { + static int i = 2; + return i; + } + return i; +} +} |