aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/stack_usage2.adb
blob: d458a929037da7732aa572a3618f996c29541eb7 (plain)
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
-- { dg-do compile }
-- { dg-options "-O2 -fstack-usage" }

with System;

procedure Stack_Usage2 is

   Sink : System.Address;
   pragma Import (Ada, Sink);

   procedure Transmit_Data (Branch : Integer) is
      pragma No_Inline (Transmit_Data);
      X : Integer;
   begin
      case Branch is
         when 1 => Sink := X'Address;
         when others => null;
      end case;
   end;

begin
   Transmit_Data (Branch => 1);
end;

-- { dg-final { scan-stack-usage-not ":Constprop" } }
-- { dg-final { cleanup-stack-usage } }