exprs.c revision cb2ca73c1d7e76cc1358ce51457d2d5837d84f9b
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
8int integer;
9long long_integer;
10double floating;
11_Complex double floating_complex;
12
13// DeclRefExpr
14int_decl_ref *int_ptr1 = &integer;
15enum_decl_ref *enum_ptr1 = &integer;
16
17// IntegerLiteral
18integer_literal *int_ptr2 = &integer;
19long_literal *long_ptr1 = &long_integer;
20
21// FloatingLiteral + ParenExpr
22floating_literal *double_ptr = &floating;
23
24// ImaginaryLiteral
25imaginary_literal *cdouble_ptr = &floating_complex;
26
27// StringLiteral
28const char* printHello() {
29  return hello;
30}
31
32// CharacterLiteral
33char_literal *int_ptr3 = &integer;
34
35// UnaryOperator
36negate_enum *int_ptr4 = &integer;
37
38// SizeOfAlignOfExpr
39typeof(sizeof(float)) size_t_value;
40typeof_sizeof *size_t_ptr = &size_t_value;
41typeof_sizeof2 *size_t_ptr2 = &size_t_value;
42
43// ArraySubscriptExpr
44array_subscript *double_ptr1_5 = &floating;
45
46// CallExpr
47call_returning_double *double_ptr2 = &floating;
48
49// MemberExpr
50member_ref_double *double_ptr3 = &floating;
51
52// BinaryOperator
53add_result *int_ptr5 = &integer;
54
55// CStyleCastExpr
56void_ptr vp1 = &integer;
57