1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s 2f4a2713aSLionel Sambuc // expected-no-diagnostics 3f4a2713aSLionel Sambuc 4f4a2713aSLionel Sambuc // PR3433 5f4a2713aSLionel Sambuc double g1; 6f4a2713aSLionel Sambuc short chk1[__alignof__(g1) == 8 ? 1 : -1]; 7f4a2713aSLionel Sambuc short chk2[__alignof__(double) == 8 ? 1 : -1]; 8f4a2713aSLionel Sambuc 9f4a2713aSLionel Sambuc long long g2; 10f4a2713aSLionel Sambuc short chk1[__alignof__(g2) == 8 ? 1 : -1]; 11f4a2713aSLionel Sambuc short chk2[__alignof__(long long) == 8 ? 1 : -1]; 12f4a2713aSLionel Sambuc 13f4a2713aSLionel Sambuc unsigned long long g5; 14f4a2713aSLionel Sambuc short chk1[__alignof__(g5) == 8 ? 1 : -1]; 15f4a2713aSLionel Sambuc short chk2[__alignof__(unsigned long long) == 8 ? 1 : -1]; 16f4a2713aSLionel Sambuc 17f4a2713aSLionel Sambuc _Complex double g3; 18f4a2713aSLionel Sambuc short chk1[__alignof__(g3) == 8 ? 1 : -1]; 19f4a2713aSLionel Sambuc short chk2[__alignof__(_Complex double) == 8 ? 1 : -1]; 20f4a2713aSLionel Sambuc 21f4a2713aSLionel Sambuc // PR6362 22f4a2713aSLionel Sambuc struct __attribute__((packed)) {unsigned int a;} g4; 23f4a2713aSLionel Sambuc short chk1[__alignof__(g4) == 1 ? 1 : -1]; 24f4a2713aSLionel Sambuc short chk2[__alignof__(g4.a) == 1 ? 1 : -1]; 25f4a2713aSLionel Sambuc 26*0a6a1f1dSLionel Sambuc double g6[3]; 27*0a6a1f1dSLionel Sambuc short chk1[__alignof__(g6) == 8 ? 1 : -1]; 28*0a6a1f1dSLionel Sambuc short chk2[__alignof__(double[3]) == 8 ? 1 : -1]; 29*0a6a1f1dSLionel Sambuc 30f4a2713aSLionel Sambuc 31f4a2713aSLionel Sambuc // PR5637 32f4a2713aSLionel Sambuc 33f4a2713aSLionel Sambuc #define ALIGNED(x) __attribute__((aligned(x))) 34f4a2713aSLionel Sambuc 35f4a2713aSLionel Sambuc typedef ALIGNED(2) struct { 36f4a2713aSLionel Sambuc char a[3]; 37f4a2713aSLionel Sambuc } T; 38f4a2713aSLionel Sambuc 39f4a2713aSLionel Sambuc short chk1[sizeof(T) == 3 ? 1 : -1]; 40f4a2713aSLionel Sambuc short chk2[sizeof(T[1]) == 4 ? 1 : -1]; 41f4a2713aSLionel Sambuc short chk3[sizeof(T[2]) == 6 ? 1 : -1]; 42f4a2713aSLionel Sambuc short chk4[sizeof(T[2][1]) == 8 ? 1 : -1]; 43f4a2713aSLionel Sambuc short chk5[sizeof(T[1][2]) == 6 ? 1 : -1]; 44f4a2713aSLionel Sambuc 45f4a2713aSLionel Sambuc typedef struct ALIGNED(2) { 46f4a2713aSLionel Sambuc char a[3]; 47f4a2713aSLionel Sambuc } T2; 48f4a2713aSLionel Sambuc 49f4a2713aSLionel Sambuc short chk1[sizeof(T2) == 4 ? 1 : -1]; 50f4a2713aSLionel Sambuc short chk2[sizeof(T2[1]) == 4 ? 1 : -1]; 51f4a2713aSLionel Sambuc short chk3[sizeof(T2[2]) == 8 ? 1 : -1]; 52f4a2713aSLionel Sambuc short chk4[sizeof(T2[2][1]) == 8 ? 1 : -1]; 53f4a2713aSLionel Sambuc short chk5[sizeof(T2[1][2]) == 8 ? 1 : -1]; 54