summaryrefslogtreecommitdiff
path: root/test/PCH
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-04-01 20:22:16 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-04-01 20:22:16 +0000
commitf396ad9b1fa0c74c9db16a8158c3882c9db774e2 (patch)
tree00203889c9adb8d6c893719c99b8313b3d69732b /test/PCH
parentefb72adbae0c253fc2fd9127fb3e1c36cb1b8d93 (diff)
downloadclang-f396ad9b1fa0c74c9db16a8158c3882c9db774e2.tar.gz
clang-f396ad9b1fa0c74c9db16a8158c3882c9db774e2.tar.bz2
clang-f396ad9b1fa0c74c9db16a8158c3882c9db774e2.tar.xz
Don't eagerly deserialize every templated function (and every static data
member inside a class template) when loading a PCH file or module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178496 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/PCH')
-rw-r--r--test/PCH/cxx-templates.cpp2
-rw-r--r--test/PCH/cxx-templates.h10
2 files changed, 11 insertions, 1 deletions
diff --git a/test/PCH/cxx-templates.cpp b/test/PCH/cxx-templates.cpp
index ddebae4df2..58c4c177fd 100644
--- a/test/PCH/cxx-templates.cpp
+++ b/test/PCH/cxx-templates.cpp
@@ -5,7 +5,7 @@
// Test with pch.
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -x c++-header -emit-pch -o %t %S/cxx-templates.h
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include-pch %t -verify %s -ast-dump -o -
-// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - -error-on-deserialized-decl doNotDeserialize | FileCheck %s
// expected-no-diagnostics
diff --git a/test/PCH/cxx-templates.h b/test/PCH/cxx-templates.h
index 00631ddbfb..e672b0b387 100644
--- a/test/PCH/cxx-templates.h
+++ b/test/PCH/cxx-templates.h
@@ -259,3 +259,13 @@ void f() {
template void f<int>();
}
+
+template<typename T> void doNotDeserialize() {}
+template<typename T> struct ContainsDoNotDeserialize {
+ static int doNotDeserialize;
+};
+template<typename T> struct ContainsDoNotDeserialize2 {
+ static void doNotDeserialize();
+};
+template<typename T> int ContainsDoNotDeserialize<T>::doNotDeserialize = 0;
+template<typename T> void ContainsDoNotDeserialize2<T>::doNotDeserialize() {}