xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/pragma-pack-6.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
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 // Pragma pack handling with tag declarations
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc struct X;
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc #pragma pack(2)
9*f4a2713aSLionel Sambuc struct X { int x; };
10*f4a2713aSLionel Sambuc struct Y;
11*f4a2713aSLionel Sambuc #pragma pack()
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc struct Y { int y; };
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc extern int check[__alignof(struct X) == 2 ? 1 : -1];
16*f4a2713aSLionel Sambuc extern int check[__alignof(struct Y) == 4 ? 1 : -1];
17*f4a2713aSLionel Sambuc 
18