1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple i686-apple-darwin9 %s -fsyntax-only -verify 2*f4a2713aSLionel Sambuc // expected-no-diagnostics 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc // Stack: [], Alignment: 8 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel Sambuc #pragma pack(push, 1) 7*f4a2713aSLionel Sambuc // Stack: [8], Alignment: 1 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuc #pragma pack(push, 4) 10*f4a2713aSLionel Sambuc // Stack: [8, 1], Alignment: 4 11*f4a2713aSLionel Sambuc 12*f4a2713aSLionel Sambuc // Note that this differs from gcc; pack() in gcc appears to pop the 13*f4a2713aSLionel Sambuc // top stack entry and resets the current alignment. This is both 14*f4a2713aSLionel Sambuc // inconsistent with MSVC, and the gcc documentation. In other cases, 15*f4a2713aSLionel Sambuc // for example changing this to pack(8), I don't even understand what gcc 16*f4a2713aSLionel Sambuc // is doing. 17*f4a2713aSLionel Sambuc 18*f4a2713aSLionel Sambuc #pragma pack() 19*f4a2713aSLionel Sambuc // Stack: [8, 1], Alignment: 8 20*f4a2713aSLionel Sambuc 21*f4a2713aSLionel Sambuc #pragma pack(pop) 22*f4a2713aSLionel Sambuc // Stack: [8], Alignment: 1 23*f4a2713aSLionel Sambuc struct s0 { 24*f4a2713aSLionel Sambuc char f0; 25*f4a2713aSLionel Sambuc short f1; 26*f4a2713aSLionel Sambuc }; 27*f4a2713aSLionel Sambuc int a[sizeof(struct s0) == 3 ? 1 : -1]; 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc #pragma pack(pop) 30*f4a2713aSLionel Sambuc // Stack: [], Alignment: 8 31*f4a2713aSLionel Sambuc struct s1 { 32*f4a2713aSLionel Sambuc char f0; 33*f4a2713aSLionel Sambuc short f1; 34*f4a2713aSLionel Sambuc }; 35*f4a2713aSLionel Sambuc int b[sizeof(struct s1) == 4 ? 1 : -1]; 36