gcc/testsuite/gnat.dg/nested_proc2.adb
raw| 1 | -- { dg-do compile } |
| 2 | -- { dg-options "-gnatws" } |
| 3 | |
| 4 | procedure Nested_Proc2 is |
| 5 | |
| 6 | type Arr is array(1..2) of Integer; |
| 7 | |
| 8 | type Rec is record |
| 9 | Data : Arr; |
| 10 | end record; |
| 11 | |
| 12 | From : Rec; |
| 13 | Index : Integer; |
| 14 | |
| 15 | function F (X : Arr) return Integer is |
| 16 | begin |
| 17 | return 0; |
| 18 | end; |
| 19 | |
| 20 | procedure Test is |
| 21 | begin |
| 22 | Index := F (From.Data); |
| 23 | If Index /= 0 then |
| 24 | raise Program_Error; |
| 25 | end if; |
| 26 | end; |
| 27 | |
| 28 | begin |
| 29 | Test; |
| 30 | end; |