blob: bcb12ee40de7f7ac5c52fa93a0da5cebf458bec7 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
Daniel Dunbar396b2a22009-02-16 23:37:57 +00002
3int x __attribute__((aligned(3))); // expected-error {{requested alignment is not a power of 2}}
Eli Friedmandcdafb62009-02-22 02:56:25 +00004
5// PR3254
6short g0[3] __attribute__((aligned));
7short g0_chk[__alignof__(g0) == 16 ? 1 : -1];
Douglas Gregor18857642009-04-30 17:32:17 +00008
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 c = 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__(c) == 1? : -1] = { 0 };
21char a3[sizeof(c) == 1? : -1] = { 0 };