gcc/testsuite/gnat.dg/return4.adb
raw| 1 | -- { dg-do run } |
| 2 | -- { dg-options "-O" } |
| 3 | |
| 4 | with Return4_Pkg; use Return4_Pkg; |
| 5 | |
| 6 | procedure Return4 is |
| 7 | |
| 8 | type Local_Rec is record |
| 9 | C : Character; |
| 10 | R : Rec; |
| 11 | end record; |
| 12 | pragma Pack (Local_Rec); |
| 13 | |
| 14 | L : Local_Rec; |
| 15 | for L'Alignment use 2; |
| 16 | |
| 17 | begin |
| 18 | L.R := Get_Value (0); |
| 19 | if L.R.I1 /= 0 then |
| 20 | raise Program_Error; |
| 21 | end if; |
| 22 | end; |