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 | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 11 | |
| 12 | // DeclRefExpr |
| 13 | int_decl_ref *int_ptr1 = &integer; |
| 14 | enum_decl_ref *enum_ptr1 = &integer; |
Douglas Gregor | 17fc223 | 2009-04-14 21:55:33 +0000 | [diff] [blame] | 15 | |
| 16 | // IntegerLiteral |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 17 | integer_literal *int_ptr2 = &integer; |
| 18 | long_literal *long_ptr1 = &long_integer; |
| 19 | |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 20 | // FloatingLiteral + ParenExpr |
Douglas Gregor | 17fc223 | 2009-04-14 21:55:33 +0000 | [diff] [blame] | 21 | floating_literal *double_ptr = &floating; |
| 22 | |
Douglas Gregor | 673ecd6 | 2009-04-15 16:35:07 +0000 | [diff] [blame] | 23 | // StringLiteral |
| 24 | const char* printHello() { |
| 25 | return hello; |
| 26 | } |
| 27 | |
Douglas Gregor | 17fc223 | 2009-04-14 21:55:33 +0000 | [diff] [blame] | 28 | // CharacterLiteral |
Douglas Gregor | 0b74891 | 2009-04-14 21:18:50 +0000 | [diff] [blame] | 29 | char_literal *int_ptr3 = &integer; |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 30 | |
Douglas Gregor | 0b0b77f | 2009-04-15 15:58:59 +0000 | [diff] [blame] | 31 | // UnaryOperator |
| 32 | negate_enum *int_ptr4 = &integer; |
| 33 | |
| 34 | // SizeOfAlignOfExpr |
| 35 | typeof(sizeof(float)) size_t_value; |
| 36 | typeof_sizeof *size_t_ptr = &size_t_value; |
| 37 | typeof_sizeof2 *size_t_ptr2 = &size_t_value; |
| 38 | |
Douglas Gregor | 1f0d013 | 2009-04-15 17:43:59 +0000 | [diff] [blame] | 39 | // CallExpr |
| 40 | call_returning_double *double_ptr2 = &floating; |
| 41 | |
| 42 | // MemberExpr |
| 43 | member_ref_double *double_ptr3 = &floating; |
| 44 | |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 45 | // BinaryOperator |
Douglas Gregor | 0b0b77f | 2009-04-15 15:58:59 +0000 | [diff] [blame] | 46 | add_result *int_ptr5 = &integer; |
Douglas Gregor | db600c3 | 2009-04-15 00:25:59 +0000 | [diff] [blame] | 47 | |
| 48 | // CStyleCastExpr |
| 49 | void_ptr vp1 = &integer; |