blob: 74fbd13d162bf40699393c9153d57b1bb3802c54 [file] [log] [blame]
Daniel Dunbarb3fc0602010-06-29 16:52:18 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
Daniel Dunbar6f739142010-05-27 18:42:17 +00002
3#pragma pack(push, 1)
4struct s0 {
5 char f0;
6 int f1 __attribute__((aligned(4)));
7};
8extern int a[sizeof(struct s0) == 5 ? 1 : -1];
9#pragma pack(pop)
10
11struct __attribute__((packed)) s1 {
12 char f0;
13 int f1 __attribute__((aligned(4)));
14};
15extern int a[sizeof(struct s1) == 8 ? 1 : -1];
16
17#pragma options align=packed
18struct s2 {
19 char f0;
20 int f1 __attribute__((aligned(4)));
21};
22extern int a[sizeof(struct s2) == 5 ? 1 : -1];
23#pragma options align=reset
Daniel Dunbarddc6ff62010-07-16 04:54:16 +000024
25#pragma pack(1)
26struct s3_0 { unsigned char f0; unsigned int f1; };
27int t3_0[sizeof(struct s3_0) == 5 ? 1 : -1];
28#pragma options align=reset
29struct s3_1 { unsigned char f0; unsigned int f1; };
30int t3_1[sizeof(struct s3_1) == 8 ? 1 : -1];