1// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
2
3int x __attribute__((aligned(3))); // expected-error {{requested alignment is not a power of 2}}
4
5// PR3254
6short g0[3] __attribute__((aligned));
7short g0_chk[__alignof__(g0) == 16 ? 1 : -1];
8
9// <rdar://problem/6840045>
10typedef char ueber_aligned_char __attribute__((aligned(8)));
11
12struct struct_with_ueber_char {
13  ueber_aligned_char c;
14};
15
16char a = 0;
17
18char a0[__alignof__(ueber_aligned_char) == 8? 1 : -1] = { 0 };
19char a1[__alignof__(struct struct_with_ueber_char) == 8? 1 : -1] = { 0 };
20char a2[__alignof__(a) == 1? : -1] = { 0 };
21char a3[sizeof(a) == 1? : -1] = { 0 };
22
23// rdar://problem/8335865
24int b __attribute__((aligned(2)));
25char b1[__alignof__(b) == 2 ?: -1] = {0};
26
27struct C { int member __attribute__((aligned(2))); } c;
28char c1[__alignof__(c) == 4 ?: -1] = {0};
29char c2[__alignof__(c.member) == 4 ?: -1] = {0};
30
31struct D { int member __attribute__((aligned(2))) __attribute__((packed)); } d;
32char d1[__alignof__(d) == 2 ?: -1] = {0};
33char d2[__alignof__(d.member) == 2 ?: -1] = {0};
34
35struct E { int member __attribute__((aligned(2))); } __attribute__((packed));
36struct E e;
37char e1[__alignof__(e) == 2 ?: -1] = {0};
38char e2[__alignof__(e.member) == 2 ?: -1] = {0};
39