gcc/testsuite/gnat.dg/release_unc_maxalign.adb
raw| 1 | -- { dg-do run } |
| 2 | |
| 3 | with Ada.Unchecked_Deallocation; |
| 4 | |
| 5 | procedure Release_UNC_Maxalign is |
| 6 | |
| 7 | type List is array (Natural range <>) of Integer; |
| 8 | for List'Alignment use Standard'Maximum_Alignment; |
| 9 | |
| 10 | type List_Access is access all List; |
| 11 | |
| 12 | procedure Release is new Ada.Unchecked_Deallocation |
| 13 | (Object => List, Name => List_Access); |
| 14 | |
| 15 | My_List : List_Access; |
| 16 | begin |
| 17 | My_List := new List (1 .. 3); |
| 18 | Release (My_List); |
| 19 | end; |