diff options
author | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | f27e5a09a0d815b8a4814152954ff87dadfdefc0 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/Sema/attr-aligned.c | |
download | FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.zip FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.tar.gz |
Import Clang, at r72732.
Diffstat (limited to 'test/Sema/attr-aligned.c')
-rw-r--r-- | test/Sema/attr-aligned.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Sema/attr-aligned.c b/test/Sema/attr-aligned.c new file mode 100644 index 0000000..6e641cb --- /dev/null +++ b/test/Sema/attr-aligned.c @@ -0,0 +1,21 @@ +// RUN: clang-cc -triple i386-apple-darwin9 -fsyntax-only -verify %s + +int x __attribute__((aligned(3))); // expected-error {{requested alignment is not a power of 2}} + +// PR3254 +short g0[3] __attribute__((aligned)); +short g0_chk[__alignof__(g0) == 16 ? 1 : -1]; + +// <rdar://problem/6840045> +typedef char ueber_aligned_char __attribute__((aligned(8))); + +struct struct_with_ueber_char { + ueber_aligned_char c; +}; + +char c = 0; + +char a0[__alignof__(ueber_aligned_char) == 8? 1 : -1] = { 0 }; +char a1[__alignof__(struct struct_with_ueber_char) == 8? 1 : -1] = { 0 }; +char a2[__alignof__(c) == 1? : -1] = { 0 }; +char a3[sizeof(c) == 1? : -1] = { 0 }; |