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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gnat.dg/] [in_out_parameter3.adb] - Blame information for rev 747

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

Line No. Rev Author Line
1 696 jeremybenn
-- { dg-do run }
2
-- { dg-options "-gnat12" }
3
 
4
procedure In_Out_Parameter3 is
5
 
6
  type Arr is array (1..16) of Integer;
7
 
8
  type Rec1 is record
9
    A : Arr;
10
    B : Boolean;
11
  end record;
12
 
13
  type Rec2 is record
14
    R : Rec1;
15
  end record;
16
  pragma Pack (Rec2);
17
 
18
  function F (I : In Out Rec1) return Boolean is
19
    A : Integer := I.A (1);
20
  begin
21
    I.A (1) := I.A (1) + 1;
22
    return (A > 0);
23
  end;
24
 
25
  I : Rec2 := (R => (A => (others => 0), B => True));
26
  B : Boolean;
27
 
28
begin
29
  B := F (I.R);
30
  if B then
31
    raise Program_Error;
32
  end if;
33
  if I.R.A (1) /= 1 then
34
    raise Program_Error;
35
  end if;
36
  if F (I.R) = False then
37
     raise Program_Error;
38
  end if;
39
  if I.R.A (1) /= 2 then
40
    raise Program_Error;
41
  end if;
42
end;

powered by: WebSVN 2.1.0

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