1 /* Copyright (C) 2002 Free Software Foundation, Inc.
3 Tests we warn about overly-large assignments to bitfields.
5 Source: Neil Booth, 28 Jan 2002.
14 struct bf p
= {4, 0}; /* { dg-warning "unsigned conversion from .int. to 'unsigned char:2' changes value from .4. to .0." } */
15 struct bf q
= {0, 2}; /* { dg-warning "overflow in conversion from .int. to .signed char:2. changes value from .2. to .-2." } */
16 struct bf r
= {3, -2}; /* { dg-bogus "(trunc|overflow)" } */
20 p
.a
= 4, p
.b
= 0; /* { dg-warning "unsigned conversion from .int. to .unsigned char:2. changes value from .4. to .0." } */
21 q
.a
= 0, q
.b
= 2; /* { dg-warning "overflow in conversion from .int. to .signed char:2. changes value from .2. to .-2." } */
22 r
.a
= 3, r
.b
= -2; /* { dg-bogus "(trunc|overflow)" } */