blob: 7fe17a576b23ac9b55c3b10d1660400e91e01ba3 [file] [log] [blame]
Douglas Gregor7eeb5972010-02-11 19:21:55 +00001// Matches
Douglas Gregor69837be2010-02-11 18:18:11 +00002struct S0 {
3 int field1;
4 float field2;
5};
6
7struct S0 x0;
8
Douglas Gregor7eeb5972010-02-11 19:21:55 +00009// Mismatch in field type
Douglas Gregor69837be2010-02-11 18:18:11 +000010struct S1 {
11 int field1;
12 float field2;
13};
14
15struct S1 x1;
Douglas Gregor7eeb5972010-02-11 19:21:55 +000016
17// Mismatch in tag kind.
18union S2 { int i; float f; } x2;
19
20// Missing fields
21struct S3 { int i; float f; } x3;
22
23// Extra fields
24struct S4 { int i; float f; } x4;
25
26// Bit-field matches
27struct S5 { int i : 8; unsigned j : 8; } x5;
28
29// Bit-field mismatch
30struct S6 { int i : 8; unsigned j; } x6;
31
32// Bit-field mismatch
33struct S7 { int i : 8; unsigned j : 16; } x7;
Douglas Gregor25791052010-02-12 00:09:27 +000034
35// Incomplete type
36struct S8 { int i; float f; } *x8;
37
38// Incomplete type
39struct S9 *x9;
40
41// Incomplete type
42struct S10 *x10;
Douglas Gregor8cdbe642010-02-12 23:44:20 +000043
44// Matches
45struct ListNode {
46 int value;
47 struct ListNode *Next;
48} xList;
Douglas Gregor3996e242010-02-15 22:01:00 +000049
50// Mismatch due to struct used internally
51struct DeepError {
52 int value;
53 struct DeeperError { int i; float f; } *Deeper;
54} xDeep;
Douglas Gregorb4964f72010-02-15 23:54:17 +000055
56// Matches
57struct {
58 int i;
59 float f;
60} x11;
Gabor Horvath5558ba22017-04-03 09:30:20 +000061
62// Matches
63typedef struct {
64 int i;
65 float f;
66} S12;
67
68S12 x12;
69
70// Mismatch
71typedef struct {
72 int i; // Mismatch here.
73 float f;
74} S13;
75
76S13 x13;