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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 696 jeremybenn
-- { dg-do compile }
2
-- { dg-options "-g -gnatVa" }
3
 
4
with Unchecked_Conversion;
5
 
6
procedure Unchecked_Convert7 is
7
 
8
  type BPA is array (1 .. 23) of Boolean;
9
  pragma Pack (BPA);
10
  for BPA'Size use 23;
11
 
12
  subtype Byte is Natural range 0 .. 255;
13
 
14
  type R is
15
    record
16
      S : Boolean;
17
      E : Byte;
18
      F : BPA;
19
    end record;
20
 
21
  for R use
22
    record
23
      S at 0 range 0 .. 0;
24
      E at 0 range 1 .. 8;
25
      F at 0 range 9 .. 31;
26
    end record;
27
  for R'Size use 32;
28
 
29
  function Conversion
30
    is new Unchecked_Conversion (Source => R, Target => Float);
31
 
32
  F : Float := Conversion (R'(False, Byte'Last, (others => False)));
33
 
34
begin
35
  null;
36
end;

powered by: WebSVN 2.1.0

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