| Dan Gohman | 0d4bbf2 | 2009-08-25 15:38:29 +0000 | [diff] [blame] | 1 | // RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null |
| Devang Patel | 9feae5c | 2007-04-05 17:14:21 +0000 | [diff] [blame] | 2 | |
| 3 | #ifdef PACKED | ||||
| 4 | #define P __attribute__((packed)) | ||||
| 5 | #else | ||||
| 6 | #define P | ||||
| 7 | #endif | ||||
| 8 | |||||
| 9 | struct UnPacked { | ||||
| 10 | int X; | ||||
| 11 | int Y; | ||||
| 12 | }; | ||||
| 13 | |||||
| 14 | struct P M_Packed { | ||||
| 15 | unsigned char A; | ||||
| 16 | struct UnPacked B; | ||||
| 17 | }; | ||||
| 18 | |||||
| 19 | struct M_Packed sM_Packed; | ||||
| 20 | |||||
| 21 | int testM_Packed (void) { | ||||
| 22 | struct M_Packed x; | ||||
| 23 | return (x.B.Y != 0); | ||||
| 24 | } | ||||
| 25 | |||||