gcc/testsuite/g++.dg/expr/bitfield8.C
raw| 1 | // PR c++/31513 |
| 2 | // { dg-do run } |
| 3 | |
| 4 | extern "C" void abort(); |
| 5 | |
| 6 | struct tree_type { |
| 7 | unsigned int precision : 9; |
| 8 | }; |
| 9 | |
| 10 | void bork(unsigned int i) { |
| 11 | if (i != 7) |
| 12 | abort(); |
| 13 | } |
| 14 | |
| 15 | void foo(struct tree_type *t) |
| 16 | { |
| 17 | bork(t->precision); |
| 18 | } |
| 19 | |
| 20 | int main() { |
| 21 | tree_type t; |
| 22 | t.precision = 7; |
| 23 | foo(&t); |
| 24 | } |