1-- { dg-do compile }
2-- { dg-options "-g" }
3
4with Debug2_Pkg; use Debug2_Pkg;
5
6package body Debug2 is
7
8    procedure Proc is
9
10        function F return String_List_Ptr is
11        begin
12            return new String_List'(Singleton);
13        end;
14
15        A : String_List_Ptr := F;
16
17    begin
18        null;
19    end;
20
21    function Get return Integer is
22    begin
23        return 0;
24    end;
25
26    Failed : exception;
27
28    A: String_Ptr;
29
30begin
31
32    declare
33        Server_Args : Integer;
34    begin
35        Server_Args := Get;
36    exception
37        when X : Failed => A := To_Heap;
38    end;
39
40end Debug2;
41