aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-15 16:52:57 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-15 16:52:57 +0000
commit25e42cba8f949f8b2e561046a7db49d674d410e1 (patch)
tree6a0835af8fab2525502189d9429f490c470bd50b
parente2657dd7aa2d5a41355f56c8dbb2104c6bf60648 (diff)
[PCH/test] Make test/PCH/cxx-typeid.cpp self-contained by including the relevant standard library declarations
instead of depending on a system header inclusion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179537 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/PCH/cxx-typeid.cpp6
-rw-r--r--test/PCH/cxx-typeid.h43
2 files changed, 45 insertions, 4 deletions
diff --git a/test/PCH/cxx-typeid.cpp b/test/PCH/cxx-typeid.cpp
index d1ad8a33ee..c6a41a15cc 100644
--- a/test/PCH/cxx-typeid.cpp
+++ b/test/PCH/cxx-typeid.cpp
@@ -1,9 +1,9 @@
// XFAIL: hexagon
// Test this without pch.
-// RUN: %clang -include %S/cxx-typeid.h -fsyntax-only -Xclang -verify %s
+// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only -verify %s
-// RUN: %clang -ccc-pch-is-pch -x c++-header -o %t.gch %S/cxx-typeid.h
-// RUN: %clang -ccc-pch-is-pch -include %t -fsyntax-only -Xclang -verify %s
+// RUN: %clang_cc1 -x c++-header -emit-pch -o %t.pch %S/cxx-typeid.h
+// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only -verify %s
// expected-no-diagnostics
diff --git a/test/PCH/cxx-typeid.h b/test/PCH/cxx-typeid.h
index aa3b16aa0b..f10f4de87c 100644
--- a/test/PCH/cxx-typeid.h
+++ b/test/PCH/cxx-typeid.h
@@ -1,3 +1,44 @@
// Header for PCH test cxx-typeid.cpp
-#include <typeinfo>
+#ifndef CXX_TYPEID_H
+#define CXX_TYPEID_H
+
+namespace std {
+
+class type_info
+{
+public:
+ virtual ~type_info();
+
+ bool operator==(const type_info& rhs) const;
+ bool operator!=(const type_info& rhs) const;
+
+ bool before(const type_info& rhs) const;
+ unsigned long hash_code() const;
+ const char* name() const;
+
+ type_info(const type_info& rhs);
+ type_info& operator=(const type_info& rhs);
+};
+
+class bad_cast
+{
+public:
+ bad_cast();
+ bad_cast(const bad_cast&);
+ bad_cast& operator=(const bad_cast&);
+ virtual const char* what() const;
+};
+
+class bad_typeid
+{
+public:
+ bad_typeid();
+ bad_typeid(const bad_typeid&);
+ bad_typeid& operator=(const bad_typeid&);
+ virtual const char* what() const;
+};
+
+} // std
+
+#endif