URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 304 |
Rev 384 |
-- { dg-do run }
|
-- { dg-do run }
|
procedure Prot_Def is
|
procedure Prot_Def is
|
|
|
protected Prot is
|
protected Prot is
|
procedure Inc;
|
procedure Inc;
|
function Get return Integer;
|
function Get return Integer;
|
private
|
private
|
Data : Integer := 0;
|
Data : Integer := 0;
|
end Prot;
|
end Prot;
|
|
|
protected body Prot is
|
protected body Prot is
|
procedure Inc is
|
procedure Inc is
|
begin
|
begin
|
Data := Data + 1;
|
Data := Data + 1;
|
end Inc;
|
end Inc;
|
function Get return Integer is
|
function Get return Integer is
|
begin
|
begin
|
return Data;
|
return Data;
|
end Get;
|
end Get;
|
end Prot;
|
end Prot;
|
|
|
generic
|
generic
|
with procedure Inc is Prot.Inc;
|
with procedure Inc is Prot.Inc;
|
with function Get return Integer is Prot.Get;
|
with function Get return Integer is Prot.Get;
|
package Gen is
|
package Gen is
|
function Add2_Get return Integer;
|
function Add2_Get return Integer;
|
end Gen;
|
end Gen;
|
|
|
package body Gen is
|
package body Gen is
|
function Add2_Get return Integer is
|
function Add2_Get return Integer is
|
begin
|
begin
|
Inc;
|
Inc;
|
Inc;
|
Inc;
|
return Get;
|
return Get;
|
end Add2_Get;
|
end Add2_Get;
|
end Gen;
|
end Gen;
|
|
|
package Inst is new Gen;
|
package Inst is new Gen;
|
|
|
begin
|
begin
|
if Inst.Add2_Get /= 2 then
|
if Inst.Add2_Get /= 2 then
|
raise Constraint_Error;
|
raise Constraint_Error;
|
end if;
|
end if;
|
end Prot_Def;
|
end Prot_Def;
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.