blob: 4b9c55f4c7dd7c091da40b4690308a438f7813b9 [file] [log] [blame]
Justin Bogner2dd68de2013-10-08 00:19:09 +00001// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2// expected-no-diagnostics
3
4typedef struct S1 { char c; } S1 __attribute__((aligned(8)));
5static_assert(alignof(S1) == 8, "attribute ignored");
6static_assert(alignof(struct S1) == 1, "attribute applied to original type");
7
8typedef struct __attribute__((aligned(8))) S2 { char c; } AS;
9static_assert(alignof(S2) == 8, "attribute not propagated");
10static_assert(alignof(struct S2) == 8, "attribute ignored");
11
12typedef struct __attribute__((aligned(4))) S3 {
13 char c;
14} S3 __attribute__((aligned(8)));
15static_assert(alignof(S3) == 8, "attribute ignored");
16static_assert(alignof(struct S3) == 4, "attribute clobbered");