Daniel Dunbar | b3fc060 | 2010-06-29 16:52:18 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Daniel Dunbar | 6f73914 | 2010-05-27 18:42:17 +0000 | [diff] [blame] | 3 | |
| 4 | #pragma pack(push, 1) |
| 5 | struct s0 { |
| 6 | char f0; |
| 7 | int f1 __attribute__((aligned(4))); |
| 8 | }; |
| 9 | extern int a[sizeof(struct s0) == 5 ? 1 : -1]; |
| 10 | #pragma pack(pop) |
| 11 | |
| 12 | struct __attribute__((packed)) s1 { |
| 13 | char f0; |
| 14 | int f1 __attribute__((aligned(4))); |
| 15 | }; |
| 16 | extern int a[sizeof(struct s1) == 8 ? 1 : -1]; |
| 17 | |
| 18 | #pragma options align=packed |
| 19 | struct s2 { |
| 20 | char f0; |
| 21 | int f1 __attribute__((aligned(4))); |
| 22 | }; |
| 23 | extern int a[sizeof(struct s2) == 5 ? 1 : -1]; |
| 24 | #pragma options align=reset |
Daniel Dunbar | ddc6ff6 | 2010-07-16 04:54:16 +0000 | [diff] [blame] | 25 | |
| 26 | #pragma pack(1) |
| 27 | struct s3_0 { unsigned char f0; unsigned int f1; }; |
| 28 | int t3_0[sizeof(struct s3_0) == 5 ? 1 : -1]; |
| 29 | #pragma options align=reset |
| 30 | struct s3_1 { unsigned char f0; unsigned int f1; }; |
| 31 | int t3_1[sizeof(struct s3_1) == 8 ? 1 : -1]; |