11eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenkounion S {
21eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko  unsigned ac : 4;
31eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko  unsigned : 4;
41eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko  unsigned clock : 1;
51eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko  unsigned : 0;
61eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko  unsigned flag : 1;
71eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko};
81eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko
91eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenkostruct X {
101eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko  unsigned light : 1;
111eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko  unsigned toaster : 1;
121eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko  int count;
131eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko  union S stat;
141eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko};
151eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko
161eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// RUN: c-index-test -test-print-bitwidth %s | FileCheck %s
171eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// CHECK: FieldDecl=ac:2:12 (Definition) bitwidth=4
181eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// CHECK: FieldDecl=:3:3 (Definition) bitwidth=4
191eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// CHECK: FieldDecl=clock:4:12 (Definition) bitwidth=1
201eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// CHECK: FieldDecl=:5:3 (Definition) bitwidth=0
211eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// CHECK: FieldDecl=flag:6:12 (Definition) bitwidth=1
221eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// CHECK: FieldDecl=light:10:12 (Definition) bitwidth=1
231eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// CHECK: FieldDecl=toaster:11:12 (Definition) bitwidth=1
241eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// CHECK-NOT: count
251eb60825f0b858a4568c1a9497cc61b0d90c9b3aDmitri Gribenko// CHECK-NOT: stat
26