1-- { dg-do compile }
2-- { dg-require-stack-check "" }
3-- { dg-options "-O -fstack-check" }
4
5package body Stack_Check3 is
6
7  type Int_Arr is array (1 .. 34) of Integer;
8
9  type Rec (D : Boolean := False) is
10    record
11      case D is
12        when True  => IA : Int_Arr;
13        when False => null;
14      end case;
15    end record;
16
17  type Rec_Arr is array (1 .. 256) of Rec;
18
19  protected Prot_Arr is
20    procedure Reset;
21  private
22    A : Rec_Arr;
23  end Prot_Arr;
24
25  protected body Prot_Arr is
26    procedure Reset is
27    begin
28      A := (others => (D => False));
29    end Reset;
30  end Prot_Arr;
31
32  procedure Reset is
33  begin
34    Prot_Arr.Reset;
35  end Reset;
36
37end Stack_Check3;
38