Sam Weinig | ce757a7 | 2010-01-16 21:21:01 +0000 | [diff] [blame] | 1 | // Test this without pch. |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame^] | 2 | // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -include %S/cxx_exprs.h -std=c++11 -fsyntax-only -verify %s -ast-dump |
Sam Weinig | ce757a7 | 2010-01-16 21:21:01 +0000 | [diff] [blame] | 3 | |
Argyrios Kyrtzidis | 5e1b7c2 | 2010-06-24 08:57:09 +0000 | [diff] [blame] | 4 | // Test with pch. Use '-ast-dump' to force deserialization of function bodies. |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame^] | 5 | // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -x c++-header -std=c++11 -emit-pch -o %t %S/cxx_exprs.h |
| 6 | // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-dump |
Sam Weinig | ce757a7 | 2010-01-16 21:21:01 +0000 | [diff] [blame] | 7 | |
| 8 | int integer; |
| 9 | double floating; |
| 10 | char character; |
Sam Weinig | eb7f961 | 2010-02-07 06:32:43 +0000 | [diff] [blame] | 11 | bool boolean; |
Sam Weinig | ce757a7 | 2010-01-16 21:21:01 +0000 | [diff] [blame] | 12 | |
| 13 | // CXXStaticCastExpr |
| 14 | static_cast_result void_ptr = &integer; |
| 15 | |
| 16 | // CXXDynamicCastExpr |
| 17 | Derived *d; |
| 18 | dynamic_cast_result derived_ptr = d; |
| 19 | |
| 20 | // CXXReinterpretCastExpr |
| 21 | reinterpret_cast_result void_ptr2 = &integer; |
| 22 | |
| 23 | // CXXConstCastExpr |
| 24 | const_cast_result char_ptr = &character; |
| 25 | |
| 26 | // CXXFunctionalCastExpr |
| 27 | functional_cast_result *double_ptr = &floating; |
Sam Weinig | eb7f961 | 2010-02-07 06:32:43 +0000 | [diff] [blame] | 28 | |
| 29 | // CXXBoolLiteralExpr |
| 30 | bool_literal_result *bool_ptr = &boolean; |
| 31 | static_assert(true_value, "true_value is true"); |
| 32 | static_assert(!false_value, "false_value is false"); |
| 33 | |
| 34 | // CXXNullPtrLiteralExpr |
| 35 | cxx_null_ptr_result null_ptr = nullptr; |
Chris Lattner | 14ab24f | 2010-05-09 06:03:39 +0000 | [diff] [blame] | 36 | |
| 37 | // CXXTypeidExpr |
| 38 | typeid_result1 typeid_1 = 0; |
Argyrios Kyrtzidis | 5e1b7c2 | 2010-06-24 08:57:09 +0000 | [diff] [blame] | 39 | typeid_result2 typeid_2 = 0; |