From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/PCH/cxx_exprs.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 clang/test/PCH/cxx_exprs.cpp (limited to 'clang/test/PCH/cxx_exprs.cpp') diff --git a/clang/test/PCH/cxx_exprs.cpp b/clang/test/PCH/cxx_exprs.cpp new file mode 100644 index 0000000..4cd9bae --- /dev/null +++ b/clang/test/PCH/cxx_exprs.cpp @@ -0,0 +1,39 @@ +// Test this without pch. +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -include %S/cxx_exprs.h -std=c++11 -fsyntax-only -verify %s -ast-dump + +// Test with pch. Use '-ast-dump' to force deserialization of function bodies. +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -x c++-header -std=c++11 -emit-pch -o %t %S/cxx_exprs.h +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-dump + +int integer; +double floating; +char character; +bool boolean; + +// CXXStaticCastExpr +static_cast_result void_ptr = &integer; + +// CXXDynamicCastExpr +Derived *d; +dynamic_cast_result derived_ptr = d; + +// CXXReinterpretCastExpr +reinterpret_cast_result void_ptr2 = &integer; + +// CXXConstCastExpr +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; + +// CXXTypeidExpr +typeid_result1 typeid_1 = 0; +typeid_result2 typeid_2 = 0; -- cgit v1.2.3