OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gnat.dg/] [nested_proc1.adb] - Diff between revs 304 and 338

Only display areas with differences | Details | Blame | View Log

Rev 304 Rev 338
-- { dg-do run }
-- { dg-do run }
-- Test that a static link is correctly passed to a subprogram which is
-- Test that a static link is correctly passed to a subprogram which is
-- indirectly called through an aggregate.
-- indirectly called through an aggregate.
 
 
procedure Nested_Proc1 is
procedure Nested_Proc1 is
 
 
  I : Integer := 0;
  I : Integer := 0;
 
 
  procedure P1 (X : Integer) is
  procedure P1 (X : Integer) is
  begin
  begin
    I := X;
    I := X;
  end;
  end;
 
 
  type Func_Ptr is access procedure (X : Integer);
  type Func_Ptr is access procedure (X : Integer);
 
 
  type Arr is array (1..64) of Integer;
  type Arr is array (1..64) of Integer;
 
 
  type Rec is record
  type Rec is record
    F : Func_Ptr;
    F : Func_Ptr;
    A : Arr;
    A : Arr;
  end record;
  end record;
 
 
  procedure P2 (R : Rec) is
  procedure P2 (R : Rec) is
  begin
  begin
     R.F (1);
     R.F (1);
  end;
  end;
 
 
begin
begin
  P2 ((F => P1'Access, A => (others => 0)));
  P2 ((F => P1'Access, A => (others => 0)));
  if I /= 1 then
  if I /= 1 then
    raise Program_Error;
    raise Program_Error;
  end if;
  end if;
end;
end;
 
 

powered by: WebSVN 2.1.0

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