Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 1 | // Test this without pch. |
| 2 | // RUN: clang-cc -fblocks -include %S/exprs.h -fsyntax-only -verify %s |
| 3 | |
| 4 | // Test with pch. |
| 5 | // RUN: clang-cc -emit-pch -fblocks -o %t %S/exprs.h && |
| 6 | // RUN: clang-cc -fblocks -include-pch %t -fsyntax-only -verify %s |
| 7 | |
| 8 | int integer; |
| 9 | long long_integer; |
Douglas Gregor | 17fc223 | 2009-04-14 21:55:33 +0000 | [diff] [blame] | 10 | double floating; |
Douglas Gregor | cb2ca73 | 2009-04-15 22:19:53 +0000 | [diff] [blame^] | 11 | _Complex double floating_complex; |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 12 | |
| 13 | // DeclRefExpr |
| 14 | int_decl_ref *int_ptr1 = &integer; |
| 15 | enum_decl_ref *enum_ptr1 = &integer; |
Douglas Gregor | 17fc223 | 2009-04-14 21:55:33 +0000 | [diff] [blame] | 16 | |
| 17 | // IntegerLiteral |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 18 | integer_literal *int_ptr2 = &integer; |
| 19 | long_literal *long_ptr1 = &long_integer; |
| 20 | |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 21 | // FloatingLiteral + ParenExpr |
Douglas Gregor | 17fc223 | 2009-04-14 21:55:33 +0000 | [diff] [blame] | 22 | floating_literal *double_ptr = &floating; |
| 23 | |
Douglas Gregor | cb2ca73 | 2009-04-15 22:19:53 +0000 | [diff] [blame^] | 24 | // ImaginaryLiteral |
| 25 | imaginary_literal *cdouble_ptr = &floating_complex; |
| 26 | |
Douglas Gregor | 673ecd6 | 2009-04-15 16:35:07 +0000 | [diff] [blame] | 27 | // StringLiteral |
| 28 | const char* printHello() { |
| 29 | return hello; |
| 30 | } |
| 31 | |
Douglas Gregor | 17fc223 | 2009-04-14 21:55:33 +0000 | [diff] [blame] | 32 | // CharacterLiteral |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 33 | char_literal *int_ptr3 = &integer; |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 34 | |
Douglas Gregor | 0b0b77f | 2009-04-15 15:58:59 +0000 | [diff] [blame] | 35 | // UnaryOperator |
| 36 | negate_enum *int_ptr4 = &integer; |
| 37 | |
| 38 | // SizeOfAlignOfExpr |
| 39 | typeof(sizeof(float)) size_t_value; |
| 40 | typeof_sizeof *size_t_ptr = &size_t_value; |
| 41 | typeof_sizeof2 *size_t_ptr2 = &size_t_value; |
| 42 | |
Douglas Gregor | cb2ca73 | 2009-04-15 22:19:53 +0000 | [diff] [blame^] | 43 | // ArraySubscriptExpr |
| 44 | array_subscript *double_ptr1_5 = &floating; |
| 45 | |
Douglas Gregor | 1f0d013 | 2009-04-15 17:43:59 +0000 | [diff] [blame] | 46 | // CallExpr |
| 47 | call_returning_double *double_ptr2 = &floating; |
| 48 | |
| 49 | // MemberExpr |
| 50 | member_ref_double *double_ptr3 = &floating; |
| 51 | |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 52 | // BinaryOperator |
Douglas Gregor | 0b0b77f | 2009-04-15 15:58:59 +0000 | [diff] [blame] | 53 | add_result *int_ptr5 = &integer; |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 54 | |
| 55 | // CStyleCastExpr |
| 56 | void_ptr vp1 = &integer; |