blob: 7337c4c41f11c8a319f8523a8eaa0b40628400ce [file] [log] [blame]
Douglas Gregorfeb84b02009-04-14 21:18:50 +00001// 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
8int integer;
9long long_integer;
Douglas Gregore0a3a512009-04-14 21:55:33 +000010double floating;
Douglas Gregorfeb84b02009-04-14 21:18:50 +000011
12// DeclRefExpr
13int_decl_ref *int_ptr1 = &integer;
14enum_decl_ref *enum_ptr1 = &integer;
Douglas Gregore0a3a512009-04-14 21:55:33 +000015
16// IntegerLiteral
Douglas Gregorfeb84b02009-04-14 21:18:50 +000017integer_literal *int_ptr2 = &integer;
18long_literal *long_ptr1 = &long_integer;
19
Douglas Gregor67fdb082009-04-15 00:25:59 +000020// FloatingLiteral + ParenExpr
Douglas Gregore0a3a512009-04-14 21:55:33 +000021floating_literal *double_ptr = &floating;
22
Douglas Gregor958dfc92009-04-15 16:35:07 +000023// StringLiteral
24const char* printHello() {
25 return hello;
26}
27
Douglas Gregore0a3a512009-04-14 21:55:33 +000028// CharacterLiteral
Douglas Gregorfeb84b02009-04-14 21:18:50 +000029char_literal *int_ptr3 = &integer;
Douglas Gregor67fdb082009-04-15 00:25:59 +000030
Douglas Gregor0253c832009-04-15 15:58:59 +000031// UnaryOperator
32negate_enum *int_ptr4 = &integer;
33
34// SizeOfAlignOfExpr
35typeof(sizeof(float)) size_t_value;
36typeof_sizeof *size_t_ptr = &size_t_value;
37typeof_sizeof2 *size_t_ptr2 = &size_t_value;
38
Douglas Gregore20a2e52009-04-15 17:43:59 +000039// CallExpr
40call_returning_double *double_ptr2 = &floating;
41
42// MemberExpr
43member_ref_double *double_ptr3 = &floating;
44
Douglas Gregor67fdb082009-04-15 00:25:59 +000045// BinaryOperator
Douglas Gregor0253c832009-04-15 15:58:59 +000046add_result *int_ptr5 = &integer;
Douglas Gregor67fdb082009-04-15 00:25:59 +000047
48// CStyleCastExpr
49void_ptr vp1 = &integer;