1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm-only -triple i386-apple-darwin9 %s 2*f4a2713aSLionel Sambuc // rdar://8823265 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc #define ATTR __attribute__((__ms_struct__)) 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel Sambuc struct _struct_0 7*f4a2713aSLionel Sambuc { 8*f4a2713aSLionel Sambuc int member_0 : 25 ; 9*f4a2713aSLionel Sambuc short member_1 : 6 ; 10*f4a2713aSLionel Sambuc char member_2 : 2 ; 11*f4a2713aSLionel Sambuc unsigned short member_3 : 1 ; 12*f4a2713aSLionel Sambuc unsigned char member_4 : 7 ; 13*f4a2713aSLionel Sambuc short member_5 : 16 ; 14*f4a2713aSLionel Sambuc int : 0 ; 15*f4a2713aSLionel Sambuc char member_7 ; 16*f4a2713aSLionel Sambuc 17*f4a2713aSLionel Sambuc } ATTR; 18*f4a2713aSLionel Sambuc 19*f4a2713aSLionel Sambuc typedef struct _struct_0 struct_0; 20*f4a2713aSLionel Sambuc 21*f4a2713aSLionel Sambuc #define size_struct_0 20 22*f4a2713aSLionel Sambuc 23*f4a2713aSLionel Sambuc struct_0 test_struct_0 = { 18557917, 17, 3, 0, 80, 6487, 93 }; 24*f4a2713aSLionel Sambuc static int a[(size_struct_0 == sizeof (struct_0)) -1]; 25*f4a2713aSLionel Sambuc 26*f4a2713aSLionel Sambuc struct _struct_1 { 27*f4a2713aSLionel Sambuc int d; 28*f4a2713aSLionel Sambuc unsigned char a; 29*f4a2713aSLionel Sambuc unsigned short b:7; 30*f4a2713aSLionel Sambuc char c; 31*f4a2713aSLionel Sambuc } ATTR; 32*f4a2713aSLionel Sambuc 33*f4a2713aSLionel Sambuc typedef struct _struct_1 struct_1; 34*f4a2713aSLionel Sambuc 35*f4a2713aSLionel Sambuc #define size_struct_1 12 36*f4a2713aSLionel Sambuc 37*f4a2713aSLionel Sambuc struct_1 test_struct_1 = { 18557917, 'a', 3, 'b' }; 38*f4a2713aSLionel Sambuc 39*f4a2713aSLionel Sambuc static int a1[(size_struct_1 == sizeof (struct_1)) -1]; 40*f4a2713aSLionel Sambuc 41*f4a2713aSLionel Sambuc struct ten { 42*f4a2713aSLionel Sambuc long long a:3; 43*f4a2713aSLionel Sambuc long long b:3; 44*f4a2713aSLionel Sambuc char c; 45*f4a2713aSLionel Sambuc } __attribute__ ((ms_struct)); 46*f4a2713aSLionel Sambuc 47*f4a2713aSLionel Sambuc #define size_struct_2 16 48*f4a2713aSLionel Sambuc 49*f4a2713aSLionel Sambuc static int a2[(size_struct_2 == sizeof (struct ten)) -1]; 50