aboutsummaryrefslogtreecommitdiff
path: root/test/PCH
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-02-16 09:31:36 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-02-16 09:31:36 +0000
commitecb7e5c8afe929ee38155db94de6b084ec32a645 (patch)
tree53010172e19c77ea447bcd89e117cda052ab52e0 /test/PCH
parent5044f5c816adfd5cba17f1adee1a10127296d0bf (diff)
downloadsrc-ecb7e5c8afe929ee38155db94de6b084ec32a645.tar.gz
src-ecb7e5c8afe929ee38155db94de6b084ec32a645.zip
Notes
Diffstat (limited to 'test/PCH')
-rw-r--r--test/PCH/cxx_exprs.cpp15
-rw-r--r--test/PCH/cxx_exprs.h18
2 files changed, 25 insertions, 8 deletions
diff --git a/test/PCH/cxx_exprs.cpp b/test/PCH/cxx_exprs.cpp
index 51269d57b147..0f0fe88dc54a 100644
--- a/test/PCH/cxx_exprs.cpp
+++ b/test/PCH/cxx_exprs.cpp
@@ -1,13 +1,14 @@
// Test this without pch.
-// RUN: %clang_cc1 -include %S/cxx_exprs.h -fsyntax-only -verify %s
+// RUN: %clang_cc1 -include %S/cxx_exprs.h -std=c++0x -fsyntax-only -verify %s
// Test with pch.
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx_exprs.h
-// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c++-header -std=c++0x -emit-pch -o %t %S/cxx_exprs.h
+// RUN: %clang_cc1 -std=c++0x -include-pch %t -fsyntax-only -verify %s
int integer;
double floating;
char character;
+bool boolean;
// CXXStaticCastExpr
static_cast_result void_ptr = &integer;
@@ -24,3 +25,11 @@ const_cast_result char_ptr = &character;
// CXXFunctionalCastExpr
functional_cast_result *double_ptr = &floating;
+
+// CXXBoolLiteralExpr
+bool_literal_result *bool_ptr = &boolean;
+static_assert(true_value, "true_value is true");
+static_assert(!false_value, "false_value is false");
+
+// CXXNullPtrLiteralExpr
+cxx_null_ptr_result null_ptr = nullptr;
diff --git a/test/PCH/cxx_exprs.h b/test/PCH/cxx_exprs.h
index b64942849419..a871aa201f12 100644
--- a/test/PCH/cxx_exprs.h
+++ b/test/PCH/cxx_exprs.h
@@ -1,21 +1,29 @@
// Header for PCH test cxx_exprs.cpp
// CXXStaticCastExpr
-typedef typeof(static_cast<void *>(0)) static_cast_result;
+typedef __typeof__(static_cast<void *>(0)) static_cast_result;
// CXXDynamicCastExpr
struct Base { virtual void f(); };
struct Derived : Base { };
Base *base_ptr;
-typedef typeof(dynamic_cast<Derived *>(base_ptr)) dynamic_cast_result;
+typedef __typeof__(dynamic_cast<Derived *>(base_ptr)) dynamic_cast_result;
// CXXReinterpretCastExpr
-typedef typeof(reinterpret_cast<void *>(0)) reinterpret_cast_result;
+typedef __typeof__(reinterpret_cast<void *>(0)) reinterpret_cast_result;
// CXXConstCastExpr
const char *const_char_ptr_value;
-typedef typeof(const_cast<char *>(const_char_ptr_value)) const_cast_result;
+typedef __typeof__(const_cast<char *>(const_char_ptr_value)) const_cast_result;
// CXXFunctionalCastExpr
int int_value;
-typedef typeof(double(int_value)) functional_cast_result;
+typedef __typeof__(double(int_value)) functional_cast_result;
+
+// CXXBoolLiteralExpr
+typedef __typeof__(true) bool_literal_result;
+const bool true_value = true;
+const bool false_value = false;
+
+// CXXNullPtrLiteralExpr
+typedef __typeof__(nullptr) cxx_null_ptr_result;