summaryrefslogtreecommitdiffstats
path: root/test/PCH/chain-cxx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/PCH/chain-cxx.cpp')
-rw-r--r--test/PCH/chain-cxx.cpp35
1 files changed, 32 insertions, 3 deletions
diff --git a/test/PCH/chain-cxx.cpp b/test/PCH/chain-cxx.cpp
index d269de5..af0a23a 100644
--- a/test/PCH/chain-cxx.cpp
+++ b/test/PCH/chain-cxx.cpp
@@ -4,9 +4,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -include %s -include %s %s
// With PCH
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t1 %s
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t2 %s -include-pch %t1 -chained-pch
-// RUN: %clang_cc1 -fsyntax-only -verify -include-pch %t2 %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s -chain-include %s -chain-include %s
#ifndef HEADER1
#define HEADER1
@@ -34,9 +32,26 @@ struct S<T *> { typedef int H; };
template <typename T> struct TS2;
typedef TS2<int> TS2int;
+template <typename T> struct TestBaseSpecifiers { };
+template<typename T> struct TestBaseSpecifiers2 : TestBaseSpecifiers<T> { };
+
+template <typename T>
+struct TS3 {
+ static const int value = 0;
+};
+template <typename T>
+const int TS3<T>::value;
+// Instantiate struct, but not value.
+struct instantiate : TS3<int> {};
+
+
//===----------------------------------------------------------------------===//
#elif not defined(HEADER2)
#define HEADER2
+#if !defined(HEADER1)
+#error Header inclusion order messed up
+#endif
+
//===----------------------------------------------------------------------===//
// Dependent header for C++ chained PCH test
@@ -73,6 +88,15 @@ struct S<int &> { typedef int L; };
template <typename T> struct TS2 { };
+struct TestBaseSpecifiers3 { };
+struct TestBaseSpecifiers4 : TestBaseSpecifiers3 { };
+
+struct A { };
+struct B : A { };
+
+// Instantiate TS3's member.
+static const int ts3m1 = TS3<int>::value;
+
//===----------------------------------------------------------------------===//
#else
//===----------------------------------------------------------------------===//
@@ -96,7 +120,12 @@ void test() {
typedef S<int &>::L T6;
TS2int ts2;
+
+ B b;
}
+// Should have remembered that there is a definition.
+static const int ts3m2 = TS3<int>::value;
+
//===----------------------------------------------------------------------===//
#endif
OpenPOWER on IntegriCloud