summaryrefslogtreecommitdiffstats
path: root/stack_check/stack_check.adb
blob: 575d967fe471679a1f44ce125471eb87049d882b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--
--  Blow the stack
--
--  $Id$
--

with Text_IO; use Text_IO;

procedure stack_check is

   type UselessArrayType is array (1 .. 512) of Natural;
   UselessArray : UselessArrayType;

   procedure BlowMe (
      N  : in      Natural;
      U  : in  out UselessArrayType
   ) is
     MyUselessArray : UselessArrayType;
   begin
      Text_IO.Put_Line ( "Call depth = " & Natural'Image(N) );
      U(5) := N;
      U(6) := N+1;
      BlowMe (N + 1, MyUselessArray);
      U(5) := MyUselessArray(10);
   end BlowMe;

begin
   Put_Line ("*** GNAT/RTEMS Stack Checker Test ***");
   BlowMe (1, UselessArray);
end stack_check;