summaryrefslogtreecommitdiff
path: root/clang/test/PCH/exprs.c
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
committerCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
commitbe1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch)
tree1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/PCH/exprs.c
parentc4626a62754862d20b41e8a46a3574264ea80e6d (diff)
parentf1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff)
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/PCH/exprs.c')
-rw-r--r--clang/test/PCH/exprs.c98
1 files changed, 98 insertions, 0 deletions
diff --git a/clang/test/PCH/exprs.c b/clang/test/PCH/exprs.c
new file mode 100644
index 0000000..5928abd
--- /dev/null
+++ b/clang/test/PCH/exprs.c
@@ -0,0 +1,98 @@
+// Test this without pch.
+// RUN: %clang_cc1 -fblocks -include %S/exprs.h -fsyntax-only -verify %s
+
+// Test with pch.
+// RUN: %clang_cc1 -emit-pch -fblocks -o %t %S/exprs.h
+// RUN: %clang_cc1 -fblocks -include-pch %t -fsyntax-only -verify %s
+
+__SIZE_TYPE__ size_type_value;
+int integer;
+long long_integer;
+double floating;
+_Complex double floating_complex;
+
+// DeclRefExpr
+int_decl_ref *int_ptr1 = &integer;
+enum_decl_ref *enum_ptr1 = &integer;
+
+// IntegerLiteral
+integer_literal *int_ptr2 = &integer;
+long_literal *long_ptr1 = &long_integer;
+
+// FloatingLiteral + ParenExpr
+floating_literal *double_ptr = &floating;
+
+// ImaginaryLiteral
+imaginary_literal *cdouble_ptr = &floating_complex;
+
+// StringLiteral
+const char* printHello() {
+ return hello;
+}
+
+// CharacterLiteral
+char_literal *int_ptr3 = &integer;
+
+// UnaryOperator
+negate_enum *int_ptr4 = &integer;
+
+// OffsetOfExpr
+offsetof_type *offsetof_ptr = &size_type_value;
+
+// UnaryExprOrTypeTraitExpr
+typeof(sizeof(float)) size_t_value;
+typeof_sizeof *size_t_ptr = &size_t_value;
+typeof_sizeof2 *size_t_ptr2 = &size_t_value;
+
+// ArraySubscriptExpr
+array_subscript *double_ptr1_5 = &floating;
+
+// CallExpr
+call_returning_double *double_ptr2 = &floating;
+
+// MemberExpr
+member_ref_double *double_ptr3 = &floating;
+
+// BinaryOperator
+add_result *int_ptr5 = &integer;
+
+// CompoundAssignOperator
+addeq_result *int_ptr6 = &integer;
+
+add_result_with_typeinfo *int_typeinfo_ptr6;
+
+// ConditionalOperator
+conditional_operator *double_ptr4 = &floating;
+
+// CStyleCastExpr
+void_ptr vp1 = &integer;
+
+// CompoundLiteral
+struct S s;
+compound_literal *sptr = &s;
+
+// ExtVectorElementExpr
+ext_vector_element *double_ptr5 = &floating;
+
+// InitListExpr
+double get_from_double_array(unsigned Idx) { return double_array[Idx]; }
+
+/// DesignatedInitExpr
+float get_from_designated(unsigned Idx) {
+ return designated_inits[2].y;
+}
+
+// TypesCompatibleExpr
+types_compatible *int_ptr7 = &integer;
+
+// ChooseExpr
+choose_expr *int_ptr8 = &integer;
+
+// GNUNullExpr FIXME: needs C++
+//null_type null = __null;
+
+// ShuffleVectorExpr
+shuffle_expr *vec_ptr = &vec2;
+
+// GenericSelectionExpr
+generic_selection_expr *double_ptr6 = &floating;