brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 1244b2f Raw
103 lines · c
1// Test this without pch.2// RUN: %clang_cc1 -fblocks -include %S/exprs.h -fsyntax-only -verify %s3 4// Test with pch.5// RUN: %clang_cc1 -emit-pch -fblocks -o %t %S/exprs.h6// RUN: %clang_cc1 -fblocks -include-pch %t -fsyntax-only -verify %s -DWITH_PCH7 8#ifdef WITH_PCH9// expected-no-diagnostics10#endif11 12__SIZE_TYPE__ size_type_value;13int integer;14long long_integer;15double floating;16_Complex double floating_complex;17 18// DeclRefExpr19int_decl_ref *int_ptr1 = &integer;20enum_decl_ref *enum_ptr1 = &integer;21 22// IntegerLiteral23integer_literal *int_ptr2 = &integer;24long_literal *long_ptr1 = &long_integer;25 26// FloatingLiteral + ParenExpr27floating_literal *double_ptr = &floating;28 29// ImaginaryLiteral30imaginary_literal *cdouble_ptr = &floating_complex;31 32// StringLiteral33const char* printHello(void) {34  return hello;35}36 37// CharacterLiteral38char_literal *int_ptr3 = &integer;39 40// UnaryOperator41negate_enum *int_ptr4 = &integer;42 43// OffsetOfExpr44offsetof_type *offsetof_ptr = &size_type_value;45 46// UnaryExprOrTypeTraitExpr47typeof(sizeof(float)) size_t_value;48typeof_sizeof *size_t_ptr = &size_t_value;49typeof_sizeof2 *size_t_ptr2 = &size_t_value;50 51// ArraySubscriptExpr52array_subscript *double_ptr1_5 = &floating;53 54// CallExpr55call_returning_double *double_ptr2 = &floating;56 57// MemberExpr58member_ref_double *double_ptr3 = &floating;59 60// BinaryOperator61add_result *int_ptr5 = &integer;62 63// CompoundAssignOperator64addeq_result *int_ptr6 = &integer;65 66add_result_with_typeinfo *int_typeinfo_ptr6;67 68// ConditionalOperator69conditional_operator *double_ptr4 = &floating;70 71// CStyleCastExpr72void_ptr vp1 = &integer;73 74// CompoundLiteral75struct S s;76compound_literal *sptr = &s;77 78// ExtVectorElementExpr79ext_vector_element *double_ptr5 = &floating;80 81// InitListExpr82double get_from_double_array(unsigned Idx) { return double_array[Idx]; }83 84/// DesignatedInitExpr85float get_from_designated(unsigned Idx) {86  return designated_inits[2].y;87}88 89// TypesCompatibleExpr90types_compatible *int_ptr7 = &integer;91 92// ChooseExpr93choose_expr *int_ptr8 = &integer;94 95// GNUNullExpr FIXME: needs C++96//null_type null = __null;97 98// ShuffleVectorExpr99shuffle_expr *vec_ptr = &vec2;100 101// GenericSelectionExpr102generic_selection_expr *double_ptr6 = &floating;103