blob: d3d4b37a889d99ec84f2c548703eb0239c586d3d [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 Gregor978887b2009-04-15 22:19:53 +000011_Complex double floating_complex;
Douglas Gregorfeb84b02009-04-14 21:18:50 +000012
13// DeclRefExpr
14int_decl_ref *int_ptr1 = &integer;
15enum_decl_ref *enum_ptr1 = &integer;
Douglas Gregore0a3a512009-04-14 21:55:33 +000016
17// IntegerLiteral
Douglas Gregorfeb84b02009-04-14 21:18:50 +000018integer_literal *int_ptr2 = &integer;
19long_literal *long_ptr1 = &long_integer;
20
Douglas Gregor67fdb082009-04-15 00:25:59 +000021// FloatingLiteral + ParenExpr
Douglas Gregore0a3a512009-04-14 21:55:33 +000022floating_literal *double_ptr = &floating;
23
Douglas Gregor978887b2009-04-15 22:19:53 +000024// ImaginaryLiteral
25imaginary_literal *cdouble_ptr = &floating_complex;
26
Douglas Gregor958dfc92009-04-15 16:35:07 +000027// StringLiteral
28const char* printHello() {
29 return hello;
30}
31
Douglas Gregore0a3a512009-04-14 21:55:33 +000032// CharacterLiteral
Douglas Gregorfeb84b02009-04-14 21:18:50 +000033char_literal *int_ptr3 = &integer;
Douglas Gregor67fdb082009-04-15 00:25:59 +000034
Douglas Gregor0253c832009-04-15 15:58:59 +000035// 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
Douglas Gregor978887b2009-04-15 22:19:53 +000043// ArraySubscriptExpr
44array_subscript *double_ptr1_5 = &floating;
45
Douglas Gregore20a2e52009-04-15 17:43:59 +000046// CallExpr
47call_returning_double *double_ptr2 = &floating;
48
49// MemberExpr
50member_ref_double *double_ptr3 = &floating;
51
Douglas Gregor67fdb082009-04-15 00:25:59 +000052// BinaryOperator
Douglas Gregor0253c832009-04-15 15:58:59 +000053add_result *int_ptr5 = &integer;
Douglas Gregor67fdb082009-04-15 00:25:59 +000054
Douglas Gregord4ed1142009-04-15 22:40:36 +000055// CompoundAssignOperator
56addeq_result *int_ptr6 = &integer;
57
58// ConditionalOperator
59conditional_operator *double_ptr4 = &floating;
60
Douglas Gregor67fdb082009-04-15 00:25:59 +000061// CStyleCastExpr
62void_ptr vp1 = &integer;
Douglas Gregor2ebf87172009-04-15 23:02:49 +000063
64// ExtVectorElementExpr
65ext_vector_element *double_ptr5 = &floating;
Douglas Gregor8693ec42009-04-15 23:33:31 +000066
67// TypesCompatibleExpr
68types_compatible *int_ptr7 = &integer;
69
70// ChooseExpr
71choose_expr *int_ptr8 = &integer;
72
73// GNUNullExpr FIXME: needs C++
74//null_type null = __null;
Douglas Gregora3c55902009-04-16 00:01:45 +000075
76// ShuffleVectorExpr
77shuffle_expr *vec_ptr = &vec2;