blob: 7337c4c41f11c8a319f8523a8eaa0b40628400ce [file] [log] [blame]
Douglas Gregor0b748912009-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 Gregor17fc2232009-04-14 21:55:33 +000010double floating;
Douglas Gregor0b748912009-04-14 21:18:50 +000011
12// DeclRefExpr
13int_decl_ref *int_ptr1 = &integer;
14enum_decl_ref *enum_ptr1 = &integer;
Douglas Gregor17fc2232009-04-14 21:55:33 +000015
16// IntegerLiteral
Douglas Gregor0b748912009-04-14 21:18:50 +000017integer_literal *int_ptr2 = &integer;
18long_literal *long_ptr1 = &long_integer;
19
Douglas Gregordb600c32009-04-15 00:25:59 +000020// FloatingLiteral + ParenExpr
Douglas Gregor17fc2232009-04-14 21:55:33 +000021floating_literal *double_ptr = &floating;
22
Douglas Gregor673ecd62009-04-15 16:35:07 +000023// StringLiteral
24const char* printHello() {
25 return hello;
26}
27
Douglas Gregor17fc2232009-04-14 21:55:33 +000028// CharacterLiteral
Douglas Gregor0b748912009-04-14 21:18:50 +000029char_literal *int_ptr3 = &integer;
Douglas Gregordb600c32009-04-15 00:25:59 +000030
Douglas Gregor0b0b77f2009-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 Gregor1f0d0132009-04-15 17:43:59 +000039// CallExpr
40call_returning_double *double_ptr2 = &floating;
41
42// MemberExpr
43member_ref_double *double_ptr3 = &floating;
44
Douglas Gregordb600c32009-04-15 00:25:59 +000045// BinaryOperator
Douglas Gregor0b0b77f2009-04-15 15:58:59 +000046add_result *int_ptr5 = &integer;
Douglas Gregordb600c32009-04-15 00:25:59 +000047
48// CStyleCastExpr
49void_ptr vp1 = &integer;