blob: 016c4c6beeed2f8864cc34192d12ef78063dda53 [file] [log] [blame]
Douglas Gregor0b748912009-04-14 21:18:50 +00001// Header for PCH test exprs.c
2
3// DeclRefExpr
4int i = 17;
5enum Enum { Enumerator = 18 };
6typedef typeof(i) int_decl_ref;
7typedef typeof(Enumerator) enum_decl_ref;
8
Douglas Gregor17fc2232009-04-14 21:55:33 +00009// IntegerLiteral
Douglas Gregor0b748912009-04-14 21:18:50 +000010typedef typeof(17) integer_literal;
11typedef typeof(17l) long_literal;
12
Douglas Gregordb600c32009-04-15 00:25:59 +000013// FloatingLiteral and ParenExpr
Douglas Gregorc04db4f2009-04-14 23:59:37 +000014typedef typeof((42.5)) floating_literal;
Douglas Gregor17fc2232009-04-14 21:55:33 +000015
Douglas Gregorcb2ca732009-04-15 22:19:53 +000016// ImaginaryLiteral
17typedef typeof(17.0i) imaginary_literal;
18
Douglas Gregor673ecd62009-04-15 16:35:07 +000019// StringLiteral
20const char *hello = "Hello" "PCH" "World";
21
Douglas Gregor17fc2232009-04-14 21:55:33 +000022// CharacterLiteral
Douglas Gregor0b748912009-04-14 21:18:50 +000023typedef typeof('a') char_literal;
Douglas Gregor17fc2232009-04-14 21:55:33 +000024
Douglas Gregor0b0b77f2009-04-15 15:58:59 +000025// UnaryOperator
26typedef typeof(-Enumerator) negate_enum;
27
28// SizeOfAlignOfExpr
29typedef typeof(sizeof(int)) typeof_sizeof;
30typedef typeof(sizeof(Enumerator)) typeof_sizeof2;
31
Douglas Gregorcb2ca732009-04-15 22:19:53 +000032// ArraySubscriptExpr
33extern double values[];
34typedef typeof(values[2]) array_subscript;
35
Douglas Gregor1f0d0132009-04-15 17:43:59 +000036// CallExpr
37double dplus(double x, double y);
38double d0, d1;
39typedef typeof((&dplus)(d0, d1)) call_returning_double;
40
41// MemberExpr
42struct S {
43 double x;
44};
45typedef typeof(((struct S*)0)->x) member_ref_double;
46
Douglas Gregordb600c32009-04-15 00:25:59 +000047// BinaryOperator
48typedef typeof(i + Enumerator) add_result;
49
Douglas Gregorad90e962009-04-15 22:40:36 +000050// CompoundAssignOperator
51typedef typeof(i += Enumerator) addeq_result;
52
53// ConditionalOperator
54typedef typeof(i? : d0) conditional_operator;
55
Douglas Gregordb600c32009-04-15 00:25:59 +000056// CStyleCastExpr
57typedef typeof((void *)0) void_ptr;
58