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