blob: 23885a546142adc9307f605f8ddc9a2c96835270 [file] [log] [blame]
Anders Carlsson6a24acb2008-02-16 01:20:23 +00001// RUN: clang %s -fsyntax-only -verify
2
3struct s {
4 char a;
5 int b __attribute__((packed));
6 char c;
7 int d;
8};
9
10struct __attribute__((packed)) packed_s {
11 char a;
12 int b __attribute__((packed));
13 char c;
14 int d;
15};
16
17struct fas {
18 char a;
19 int b[];
20};
21
22struct __attribute__((packed)) packed_fas {
23 char a;
24 int b[];
25};
26
27extern int a1[sizeof(struct s) == 12 ? 1 : -1];
28extern int a2[__alignof(struct s) == 4 ? 1 : -1];
29
30extern int b1[sizeof(struct packed_s) == 10 ? 1 : -1];
31extern int b2[__alignof(struct packed_s) == 1 ? 1 : -1];
32
33extern int c1[sizeof(struct fas) == 4 ? 1 : -1];
34extern int c2[__alignof(struct fas) == 4 ? 1 : -1];
35
36extern int d1[sizeof(struct packed_fas) == 1 ? 1 : -1];
37extern int d2[__alignof(struct packed_fas) == 1 ? 1 : -1];