OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gnat.dg/] [gnat_malloc.adb] - Blame information for rev 696

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 696 jeremybenn
-- { dg-do run }
2
-- { dg-options "-O2" }
3
 
4
with Unchecked_Conversion;
5
 
6
procedure gnat_malloc is
7
 
8
   type int1 is new integer;
9
   type int2 is new integer;
10
   type a1 is access int1;
11
   type a2 is access int2;
12
 
13
   function to_a2 is new Unchecked_Conversion (a1, a2);
14
 
15
   v1 : a1 := new int1;
16
   v2 : a2 := to_a2 (v1);
17
 
18
begin
19
   v1.all := 1;
20
   v2.all := 0;
21
 
22
   if v1.all /= 0 then
23
      raise Program_Error;
24
   end if;
25
end;

powered by: WebSVN 2.1.0

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