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/] [trampoline2.adb] - Rev 304

Compare with Previous | Blame | View Log

-- { dg-do run }
-- { dg-options "-gnatws" }
 
with System; use System;
 
procedure Trampoline2 is
 
  A : Integer;
 
  type FuncPtr is access function (I : Integer) return Integer;
 
  function F (I : Integer) return Integer is
  begin
    return A + I;
  end F;
 
  P : FuncPtr := F'Access;
  CA : System.Address := F'Code_Address;
  I : Integer;
 
begin
  if CA = System.Null_Address then
    raise Program_Error;
  end if;
 
  I := P(0);
end;
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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