blob: fb8da515bbc7740e8b53d68eee1d7d8a4c43f179 [file] [log] [blame]
Daniel Dunbarb3fc0602010-06-29 16:52:18 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
Daniel Dunbarc6082fe2010-05-27 05:45:51 +00002
3#include <stddef.h>
4
5#pragma options align=mac68k
6
7typedef float __attribute__((vector_size (8))) v2f_t;
8typedef float __attribute__((vector_size (16))) v4f_t;
9
10extern int a0_0[__alignof(v2f_t) == 8 ? 1 : -1];
11extern int a0_1[__alignof(v4f_t) == 16 ? 1 : -1];
12
13struct s1 {
14 char f0;
15 int f1;
16};
17extern int a1_0[offsetof(struct s1, f0) == 0 ? 1 : -1];
18extern int a1_1[offsetof(struct s1, f1) == 2 ? 1 : -1];
19extern int a1_2[sizeof(struct s1) == 6 ? 1 : -1];
20extern int a1_3[__alignof(struct s1) == 2 ? 1 : -1];
21
22struct s2 {
23 char f0;
24 double f1;
25};
26extern int a2_0[offsetof(struct s2, f0) == 0 ? 1 : -1];
27extern int a2_1[offsetof(struct s2, f1) == 2 ? 1 : -1];
28extern int a2_2[sizeof(struct s2) == 10 ? 1 : -1];
29extern int a2_3[__alignof(struct s2) == 2 ? 1 : -1];
30
31struct s3 {
32 char f0;
33 v4f_t f1;
34};
35extern int a3_0[offsetof(struct s3, f0) == 0 ? 1 : -1];
36extern int a3_1[offsetof(struct s3, f1) == 2 ? 1 : -1];
37extern int a3_2[sizeof(struct s3) == 18 ? 1 : -1];
38extern int a3_3[__alignof(struct s3) == 2 ? 1 : -1];
39
40struct s4 {
41 char f0;
42 char f1;
43};
44extern int a4_0[offsetof(struct s4, f0) == 0 ? 1 : -1];
45extern int a4_1[offsetof(struct s4, f1) == 1 ? 1 : -1];
46extern int a4_2[sizeof(struct s4) == 2 ? 1 : -1];
47extern int a4_3[__alignof(struct s4) == 2 ? 1 : -1];
48
49struct s5 {
50 unsigned f0 : 9;
51 unsigned f1 : 9;
52};
53extern int a5_0[sizeof(struct s5) == 4 ? 1 : -1];
54extern int a5_1[__alignof(struct s5) == 2 ? 1 : -1];
55
56struct s6 {
57 unsigned : 0;
58 unsigned : 0;
59};
60extern int a6_0[sizeof(struct s6) == 0 ? 1 : -1];
61extern int a6_1[__alignof(struct s6) == 2 ? 1 : -1];
62
63struct s7 {
64 char : 1;
65 unsigned : 1;
66};
67extern int a7_0[sizeof(struct s7) == 2 ? 1 : -1];
68extern int a7_1[__alignof(struct s7) == 2 ? 1 : -1];
69
70struct s8 {
71 char f0;
72 unsigned : 1;
73};
74extern int a8_0[sizeof(struct s8) == 2 ? 1 : -1];
75extern int a8_1[__alignof(struct s8) == 2 ? 1 : -1];
76
77struct s9 {
78 char f0[3];
79 unsigned : 0;
80 char f1;
81};
82extern int a9_0[sizeof(struct s9) == 6 ? 1 : -1];
83extern int a9_1[__alignof(struct s9) == 2 ? 1 : -1];
84
85struct s10 {
86 char f0;
87};
88extern int a10_0[sizeof(struct s10) == 2 ? 1 : -1];
89extern int a10_1[__alignof(struct s10) == 2 ? 1 : -1];
90
91struct s11 {
92 char f0;
93 v2f_t f1;
94};
95extern int a11_0[offsetof(struct s11, f0) == 0 ? 1 : -1];
96extern int a11_1[offsetof(struct s11, f1) == 2 ? 1 : -1];
97extern int a11_2[sizeof(struct s11) == 10 ? 1 : -1];
98extern int a11_3[__alignof(struct s11) == 2 ? 1 : -1];