gcc/testsuite/gcc.dg/bitint-34.c
raw| 1 | /* PR c/102989 */ |
| 2 | /* Test that -funsigned-bitfields doesn't affect _BitInt bit-fields which are always signed. */ |
| 3 | /* { dg-do run { target bitint } } */ |
| 4 | /* { dg-options "-std=c23 -funsigned-bitfields" } */ |
| 5 | |
| 6 | struct S { _BitInt(22) a : 7; signed _BitInt(22) b : 7; unsigned _BitInt(22) c : 7; } s; |
| 7 | |
| 8 | int |
| 9 | main () |
| 10 | { |
| 11 | s.a = -64; |
| 12 | s.b = -64; |
| 13 | s.c = -64; |
| 14 | if (s.a != -64 || s.b != -64 || s.c != 64) |
| 15 | __builtin_abort (); |
| 16 | } |