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/] [unchecked_union1.adb] - Blame information for rev 304

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 304 jeremybenn
-- { dg-do run }
2
 
3
procedure Unchecked_Union1 is
4
 
5
  type Bit is (Zero, One);
6
 
7
  type U (X : Bit := Zero) is record
8
    case X is
9
      when Zero => I: Integer;
10
      when One => F : Float;
11
    end case;
12
  end record;
13
  for U use record
14
    I at 0 range  0 .. 31;
15
    F at 0 range  0 .. 31;
16
  end record;
17
  pragma Unchecked_Union(U);
18
 
19
begin
20
  if U'Object_Size /= 32 then
21
    raise Program_Error;
22
  end if;
23
end;

powered by: WebSVN 2.1.0

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