blob: 10c8fce42ad5e35a9141cc751e874abf021fc17c [file] [log] [blame]
Douglas Gregorb203c9e2010-02-11 18:18:11 +00001typedef int Int;
2typedef float Float;
3
Douglas Gregor4800d952010-02-11 19:21:55 +00004// Matches
Douglas Gregorb203c9e2010-02-11 18:18:11 +00005struct S0 {
6 Int field1;
7 Float field2;
8};
9
10struct S0 x0;
11
Douglas Gregor4800d952010-02-11 19:21:55 +000012// Mismatch in field type
Douglas Gregorb203c9e2010-02-11 18:18:11 +000013struct S1 {
14 Int field1;
15 int field2;
16};
17
18struct S1 x1;
Douglas Gregor4800d952010-02-11 19:21:55 +000019
20// Mismatch in tag kind.
21struct S2 { int i; float f; } x2;
22
23// Missing fields
24struct S3 { int i; float f; double d; } x3;
25
26// Extra fields
27struct S4 { int i; } x4;
28
29// Bit-field matches
30struct S5 { int i : 8; unsigned j : 8; } x5;
31
32// Bit-field mismatch
33struct S6 { int i : 8; unsigned j : 8; } x6;
34
35// Bit-field mismatch
36struct S7 { int i : 8; unsigned j : 8; } x7;
Douglas Gregore72b5dc2010-02-12 00:09:27 +000037
38// Incomplete type
39struct S8 *x8;
40
41// Incomplete type
42struct S9 { int i; float f; } *x9;
43
44// Incomplete type
45struct S10 *x10;
46
Douglas Gregor5ce5dab2010-02-12 23:44:20 +000047// FIXME: Matches, but crashes the importer
48#if 0
49struct ListNode {
50 int value;
51 struct ListNode *Next;
52} xList;
53#endif