diff options
Diffstat (limited to 'gcc/testsuite/gnat.dg/stack_check3.adb')
-rw-r--r-- | gcc/testsuite/gnat.dg/stack_check3.adb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/stack_check3.adb b/gcc/testsuite/gnat.dg/stack_check3.adb new file mode 100644 index 00000000000..734ed422733 --- /dev/null +++ b/gcc/testsuite/gnat.dg/stack_check3.adb @@ -0,0 +1,36 @@ +-- { dg-do compile } +-- { dg-options "-O -fstack-check" } + +package body Stack_Check3 is + + type Int_Arr is array (1 .. 34) of Integer; + + type Rec (D : Boolean := False) is + record + case D is + when True => IA : Int_Arr; + when False => null; + end case; + end record; + + type Rec_Arr is array (1 .. 256) of Rec; + + protected Prot_Arr is + procedure Reset; + private + A : Rec_Arr; + end Prot_Arr; + + protected body Prot_Arr is + procedure Reset is + begin + A := (others => (D => False)); + end Reset; + end Prot_Arr; + + procedure Reset is + begin + Prot_Arr.Reset; + end Reset; + +end Stack_Check3; |