1335552e3fff9f41067cccfd72557f801d398949aEric Christopher// RUN: %clang_cc1 -emit-llvm %s -o -
2335552e3fff9f41067cccfd72557f801d398949aEric Christopher
3335552e3fff9f41067cccfd72557f801d398949aEric Christopher#ifdef PACKED
4335552e3fff9f41067cccfd72557f801d398949aEric Christopher#define P __attribute__((packed))
5335552e3fff9f41067cccfd72557f801d398949aEric Christopher#else
6335552e3fff9f41067cccfd72557f801d398949aEric Christopher#define P
7335552e3fff9f41067cccfd72557f801d398949aEric Christopher#endif
8335552e3fff9f41067cccfd72557f801d398949aEric Christopher
9335552e3fff9f41067cccfd72557f801d398949aEric Christopherstruct P M_Packed {
10335552e3fff9f41067cccfd72557f801d398949aEric Christopher  unsigned long sorted : 1;
11335552e3fff9f41067cccfd72557f801d398949aEric Christopher  unsigned long from_array : 1;
12335552e3fff9f41067cccfd72557f801d398949aEric Christopher  unsigned long mixed_encoding : 1;
13335552e3fff9f41067cccfd72557f801d398949aEric Christopher  unsigned long encoding : 8;
14335552e3fff9f41067cccfd72557f801d398949aEric Christopher  unsigned long count : 21;
15335552e3fff9f41067cccfd72557f801d398949aEric Christopher
16335552e3fff9f41067cccfd72557f801d398949aEric Christopher};
17335552e3fff9f41067cccfd72557f801d398949aEric Christopher
18335552e3fff9f41067cccfd72557f801d398949aEric Christopherstruct M_Packed sM_Packed;
19335552e3fff9f41067cccfd72557f801d398949aEric Christopher
20335552e3fff9f41067cccfd72557f801d398949aEric Christopherint testM_Packed (void) {
21335552e3fff9f41067cccfd72557f801d398949aEric Christopher  struct M_Packed x;
22335552e3fff9f41067cccfd72557f801d398949aEric Christopher  return (x.count != 0);
23335552e3fff9f41067cccfd72557f801d398949aEric Christopher}
24