gcc/testsuite/gnat.dg/array36.adb
raw| 1 | -- { dg-do run } |
| 2 | |
| 3 | procedure Array36 is |
| 4 | |
| 5 | subtype Str is String (1 .. 3); |
| 6 | |
| 7 | type Rec is record |
| 8 | S : Str; |
| 9 | end record; |
| 10 | |
| 11 | type T is record |
| 12 | B : Boolean; |
| 13 | R : Rec; |
| 14 | end record; |
| 15 | |
| 16 | for T use record |
| 17 | B at 0 range 0 .. 0; |
| 18 | R at 0 range 1 .. 24; |
| 19 | end record; |
| 20 | |
| 21 | X : T := (B => True, R => (S => "123")); |
| 22 | |
| 23 | begin |
| 24 | X.B := False; |
| 25 | if X.R.S /= "123" then |
| 26 | raise Program_Error; |
| 27 | end if; |
| 28 | end; |