llvm-project
102 строки · 2.2 Кб
1// Test this without pch.
2// RUN: %clang_cc1 -fblocks -include %S/exprs.h -fsyntax-only -verify %s
3
4// Test with pch.
5// RUN: %clang_cc1 -emit-pch -fblocks -o %t %S/exprs.h
6// RUN: %clang_cc1 -fblocks -include-pch %t -fsyntax-only -verify %s -DWITH_PCH
7
8#ifdef WITH_PCH9// expected-no-diagnostics
10#endif11
12__SIZE_TYPE__ size_type_value;13int integer;14long long_integer;15double floating;16_Complex double floating_complex;17
18// DeclRefExpr
19int_decl_ref *int_ptr1 = &integer;20enum_decl_ref *enum_ptr1 = &integer;21
22// IntegerLiteral
23integer_literal *int_ptr2 = &integer;24long_literal *long_ptr1 = &long_integer;25
26// FloatingLiteral + ParenExpr
27floating_literal *double_ptr = &floating;28
29// ImaginaryLiteral
30imaginary_literal *cdouble_ptr = &floating_complex;31
32// StringLiteral
33const char* printHello(void) {34return hello;35}
36
37// CharacterLiteral
38char_literal *int_ptr3 = &integer;39
40// UnaryOperator
41negate_enum *int_ptr4 = &integer;42
43// OffsetOfExpr
44offsetof_type *offsetof_ptr = &size_type_value;45
46// UnaryExprOrTypeTraitExpr
47typeof(sizeof(float)) size_t_value;48typeof_sizeof *size_t_ptr = &size_t_value;49typeof_sizeof2 *size_t_ptr2 = &size_t_value;50
51// ArraySubscriptExpr
52array_subscript *double_ptr1_5 = &floating;53
54// CallExpr
55call_returning_double *double_ptr2 = &floating;56
57// MemberExpr
58member_ref_double *double_ptr3 = &floating;59
60// BinaryOperator
61add_result *int_ptr5 = &integer;62
63// CompoundAssignOperator
64addeq_result *int_ptr6 = &integer;65
66add_result_with_typeinfo *int_typeinfo_ptr6;67
68// ConditionalOperator
69conditional_operator *double_ptr4 = &floating;70
71// CStyleCastExpr
72void_ptr vp1 = &integer;73
74// CompoundLiteral
75struct S s;76compound_literal *sptr = &s;77
78// ExtVectorElementExpr
79ext_vector_element *double_ptr5 = &floating;80
81// InitListExpr
82double get_from_double_array(unsigned Idx) { return double_array[Idx]; }83
84/// DesignatedInitExpr
85float get_from_designated(unsigned Idx) {86return designated_inits[2].y;87}
88
89// TypesCompatibleExpr
90types_compatible *int_ptr7 = &integer;91
92// ChooseExpr
93choose_expr *int_ptr8 = &integer;94
95// GNUNullExpr FIXME: needs C++
96//null_type null = __null;
97
98// ShuffleVectorExpr
99shuffle_expr *vec_ptr = &vec2;100
101// GenericSelectionExpr
102generic_selection_expr *double_ptr6 = &floating;103