URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 304 |
Rev 384 |
-- { dg-do run }
|
-- { dg-do run }
|
-- { dg-options "-O2" }
|
-- { dg-options "-O2" }
|
|
|
with Unchecked_Conversion;
|
with Unchecked_Conversion;
|
|
|
procedure gnat_malloc is
|
procedure gnat_malloc is
|
|
|
type int1 is new integer;
|
type int1 is new integer;
|
type int2 is new integer;
|
type int2 is new integer;
|
type a1 is access int1;
|
type a1 is access int1;
|
type a2 is access int2;
|
type a2 is access int2;
|
|
|
function to_a2 is new Unchecked_Conversion (a1, a2);
|
function to_a2 is new Unchecked_Conversion (a1, a2);
|
|
|
v1 : a1 := new int1;
|
v1 : a1 := new int1;
|
v2 : a2 := to_a2 (v1);
|
v2 : a2 := to_a2 (v1);
|
|
|
begin
|
begin
|
v1.all := 1;
|
v1.all := 1;
|
v2.all := 0;
|
v2.all := 0;
|
|
|
if v1.all /= 0 then
|
if v1.all /= 0 then
|
raise Program_Error;
|
raise Program_Error;
|
end if;
|
end if;
|
end;
|
end;
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.