xref: /llvm-project/clang/test/SemaObjC/pragma-pack.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -triple i686-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
2// expected-no-diagnostics
3
4// Make sure pragma pack works inside ObjC methods.
5@interface X
6@end
7@implementation X
8- (void)Y {
9#pragma pack(push, 1)
10  struct x {
11    char a;
12    int b;
13  };
14#pragma pack(pop)
15  typedef char check_[sizeof (struct x) == 5 ? 1 : -1];
16}
17@end
18