OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gnat.dg/] [mutable1.adb] - Blame information for rev 313

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 304 jeremybenn
-- { dg-do run }
2
 
3
procedure mutable1 is
4
 
5
   type Object (Valid : Boolean := False) is record
6
      case Valid is
7
         when True  => Stamp : Natural;
8
         when False => null;
9
      end case;
10
   end record;
11
 
12
   function Dummy_Object (Should_Be_There : Boolean) Return Object is
13
   begin
14
      if not Should_Be_There then
15
         raise Program_Error;
16
      end if;
17
      return Object'(Valid => False);
18
   end;
19
 
20
   procedure Check (Create_Dummy : Boolean) is
21
      B : Boolean;
22
   begin
23
      B := Create_Dummy and then Dummy_Object (Create_Dummy).Valid;
24
   end;
25
 
26
begin
27
   Check (Create_Dummy => False);
28
   Check (Create_Dummy => True);
29
end;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.