2009-04-15 05:18:50 +08:00
|
|
|
// Test this without pch.
|
2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fblocks -include %S/exprs.h -fsyntax-only -verify %s
|
2009-04-15 05:18:50 +08:00
|
|
|
|
|
|
|
// Test with pch.
|
2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -emit-pch -fblocks -o %t %S/exprs.h
|
|
|
|
// RUN: %clang_cc1 -fblocks -include-pch %t -fsyntax-only -verify %s
|
2009-04-15 05:18:50 +08:00
|
|
|
|
|
|
|
int integer;
|
|
|
|
long long_integer;
|
2009-04-15 05:55:33 +08:00
|
|
|
double floating;
|
2009-04-16 06:19:53 +08:00
|
|
|
_Complex double floating_complex;
|
2009-04-15 05:18:50 +08:00
|
|
|
|
|
|
|
// DeclRefExpr
|
|
|
|
int_decl_ref *int_ptr1 = &integer;
|
|
|
|
enum_decl_ref *enum_ptr1 = &integer;
|
2009-04-15 05:55:33 +08:00
|
|
|
|
|
|
|
// IntegerLiteral
|
2009-04-15 05:18:50 +08:00
|
|
|
integer_literal *int_ptr2 = &integer;
|
|
|
|
long_literal *long_ptr1 = &long_integer;
|
|
|
|
|
2009-04-15 08:25:59 +08:00
|
|
|
// FloatingLiteral + ParenExpr
|
2009-04-15 05:55:33 +08:00
|
|
|
floating_literal *double_ptr = &floating;
|
|
|
|
|
2009-04-16 06:19:53 +08:00
|
|
|
// ImaginaryLiteral
|
|
|
|
imaginary_literal *cdouble_ptr = &floating_complex;
|
|
|
|
|
2009-04-16 00:35:07 +08:00
|
|
|
// StringLiteral
|
|
|
|
const char* printHello() {
|
|
|
|
return hello;
|
|
|
|
}
|
|
|
|
|
2009-04-15 05:55:33 +08:00
|
|
|
// CharacterLiteral
|
2009-04-15 05:18:50 +08:00
|
|
|
char_literal *int_ptr3 = &integer;
|
2009-04-15 08:25:59 +08:00
|
|
|
|
2009-04-15 23:58:59 +08:00
|
|
|
// UnaryOperator
|
|
|
|
negate_enum *int_ptr4 = &integer;
|
|
|
|
|
|
|
|
// SizeOfAlignOfExpr
|
|
|
|
typeof(sizeof(float)) size_t_value;
|
|
|
|
typeof_sizeof *size_t_ptr = &size_t_value;
|
|
|
|
typeof_sizeof2 *size_t_ptr2 = &size_t_value;
|
|
|
|
|
2009-04-16 06:19:53 +08:00
|
|
|
// ArraySubscriptExpr
|
|
|
|
array_subscript *double_ptr1_5 = &floating;
|
|
|
|
|
2009-04-16 01:43:59 +08:00
|
|
|
// CallExpr
|
|
|
|
call_returning_double *double_ptr2 = &floating;
|
|
|
|
|
|
|
|
// MemberExpr
|
|
|
|
member_ref_double *double_ptr3 = &floating;
|
|
|
|
|
2009-04-15 08:25:59 +08:00
|
|
|
// BinaryOperator
|
2009-04-15 23:58:59 +08:00
|
|
|
add_result *int_ptr5 = &integer;
|
2009-04-15 08:25:59 +08:00
|
|
|
|
2009-04-16 06:40:36 +08:00
|
|
|
// CompoundAssignOperator
|
|
|
|
addeq_result *int_ptr6 = &integer;
|
|
|
|
|
|
|
|
// ConditionalOperator
|
|
|
|
conditional_operator *double_ptr4 = &floating;
|
|
|
|
|
2009-04-15 08:25:59 +08:00
|
|
|
// CStyleCastExpr
|
|
|
|
void_ptr vp1 = &integer;
|
2009-04-16 07:02:49 +08:00
|
|
|
|
2009-04-16 10:33:48 +08:00
|
|
|
// CompoundLiteral
|
|
|
|
struct S s;
|
|
|
|
compound_literal *sptr = &s;
|
|
|
|
|
2009-04-16 07:02:49 +08:00
|
|
|
// ExtVectorElementExpr
|
|
|
|
ext_vector_element *double_ptr5 = &floating;
|
2009-04-16 07:33:31 +08:00
|
|
|
|
2009-04-16 08:55:48 +08:00
|
|
|
// InitListExpr
|
|
|
|
double get_from_double_array(unsigned Idx) { return double_array[Idx]; }
|
|
|
|
|
|
|
|
/// DesignatedInitExpr
|
|
|
|
float get_from_designated(unsigned Idx) {
|
|
|
|
return designated_inits[2].y;
|
|
|
|
}
|
|
|
|
|
2009-04-16 07:33:31 +08:00
|
|
|
// TypesCompatibleExpr
|
|
|
|
types_compatible *int_ptr7 = &integer;
|
|
|
|
|
|
|
|
// ChooseExpr
|
|
|
|
choose_expr *int_ptr8 = &integer;
|
|
|
|
|
|
|
|
// GNUNullExpr FIXME: needs C++
|
|
|
|
//null_type null = __null;
|
2009-04-16 08:01:45 +08:00
|
|
|
|
|
|
|
// ShuffleVectorExpr
|
|
|
|
shuffle_expr *vec_ptr = &vec2;
|