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/] [in_out_parameter.adb] - Blame information for rev 310

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

Line No. Rev Author Line
1 304 jeremybenn
-- { dg-do run }
2
 
3
with Ada.Streams.Stream_IO;
4
 
5
procedure In_Out_Parameter is
6
 
7
   use Ada.Streams;  use Stream_IO;
8
 
9
   File : Stream_IO.File_Type;
10
 
11
   type Bitmap is array (Natural range <>) of Boolean;
12
   for Bitmap'Component_Size use 1;
13
 
14
   type Message   is record
15
      B : Bitmap (0 .. 14);
16
   end record;
17
   for Message use record
18
      B  at 0 range 2 .. 16;
19
   end record;
20
 
21
   TX, RX : Message;
22
 
23
begin
24
 
25
   TX.B  := (others => False);
26
   Stream_IO.Create (File => File, Mode => Out_File, Name => "data");
27
   Message'Output (Stream (File), TX);
28
   Stream_IO.Close (File);
29
   --
30
   Stream_IO.Open (File => File, Mode => In_File, Name => "data");
31
   RX := Message'Input (Stream (File));
32
   Stream_IO.Close (File);
33
 
34
   if RX /= TX then
35
      raise Program_Error;
36
   end if;
37
 
38
end In_Out_Parameter;

powered by: WebSVN 2.1.0

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