1// RUN: %clang_cc1 -triple i686-apple-darwin9 -fsyntax-only -verify %s
2
3namespace rdar8745206 {
4
5struct Base {
6  int i;
7};
8
9#pragma pack(push, 1)
10struct Sub : public Base {
11  char c;
12};
13#pragma pack(pop)
14
15int check[sizeof(Sub) == 5 ? 1 : -1];
16
17}
18
19namespace check2 {
20
21struct Base {
22  virtual ~Base();
23  int x;
24};
25
26#pragma pack(push, 1)
27struct Sub : virtual Base {
28  char c;
29};
30#pragma pack(pop)
31
32int check[sizeof(Sub) == 13 ? 1 : -1];
33
34}
35
36namespace llvm_support_endian {
37
38template<typename, bool> struct X;
39
40#pragma pack(push)
41#pragma pack(1)
42template<typename T> struct X<T, true> {
43  T t;
44};
45#pragma pack(pop)
46
47#pragma pack(push)
48#pragma pack(2)
49template<> struct X<long double, true> {
50  long double c;
51};
52#pragma pack(pop)
53
54int check1[__alignof(X<int, true>) == 1 ? 1 : -1];
55int check2[__alignof(X<long double, true>) == 2 ? 1 : -1];
56
57}
58