1*67e74705SXin Li // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s 2*67e74705SXin Li // expected-no-diagnostics 3*67e74705SXin Li 4*67e74705SXin Li typedef struct S1 { char c; } S1 __attribute__((aligned(8))); 5*67e74705SXin Li static_assert(alignof(S1) == 8, "attribute ignored"); 6*67e74705SXin Li static_assert(alignof(struct S1) == 1, "attribute applied to original type"); 7*67e74705SXin Li 8*67e74705SXin Li typedef struct __attribute__((aligned(8))) S2 { char c; } AS; 9*67e74705SXin Li static_assert(alignof(S2) == 8, "attribute not propagated"); 10*67e74705SXin Li static_assert(alignof(struct S2) == 8, "attribute ignored"); 11*67e74705SXin Li 12*67e74705SXin Li typedef struct __attribute__((aligned(4))) S3 { 13*67e74705SXin Li char c; 14*67e74705SXin Li } S3 __attribute__((aligned(8))); 15*67e74705SXin Li static_assert(alignof(S3) == 8, "attribute ignored"); 16*67e74705SXin Li static_assert(alignof(struct S3) == 4, "attribute clobbered"); 17