URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 304 |
Rev 338 |
-- { dg-do run }
|
-- { dg-do run }
|
|
|
pragma Restrictions (No_Finalization);
|
pragma Restrictions (No_Finalization);
|
procedure no_final is
|
procedure no_final is
|
package P is
|
package P is
|
type T is tagged null record;
|
type T is tagged null record;
|
type T1 is new T with record
|
type T1 is new T with record
|
A : String (1..80);
|
A : String (1..80);
|
end record;
|
end record;
|
function F return T'Class;
|
function F return T'Class;
|
end P;
|
end P;
|
|
|
Str : String (1..80) := (1..80=>'x');
|
Str : String (1..80) := (1..80=>'x');
|
|
|
package body P is
|
package body P is
|
function F return T'Class is
|
function F return T'Class is
|
X : T1 := T1'(A => Str);
|
X : T1 := T1'(A => Str);
|
begin
|
begin
|
return X;
|
return X;
|
end F;
|
end F;
|
end P;
|
end P;
|
|
|
Obj : P.T'class := P.F;
|
Obj : P.T'class := P.F;
|
begin
|
begin
|
if P.T1 (Obj).A /= Str then
|
if P.T1 (Obj).A /= Str then
|
raise Constraint_Error;
|
raise Constraint_Error;
|
end if;
|
end if;
|
end;
|
end;
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.