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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gnat.dg/] [unchecked_convert8.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 -O" }
3
 
4
with Ada.Unchecked_Conversion;
5
 
6
package body Unchecked_Convert8 is
7
 
8
   type T1 is range 0 .. 255;
9
 
10
   type T2 is
11
      record
12
         A : T1;
13
         B : T1;
14
      end record;
15
 
16
   for T2 use
17
      record
18
         A at 0 range 0 .. 7;
19
         B at 1 range 0 .. 7;
20
      end record;
21
 
22
   for T2'Size use 16;
23
 
24
   type T3 is range 0 .. (2**16 - 1);
25
   for  T3'Size use 16;
26
 
27
   function T2_TO_T3 is
28
      new Ada.Unchecked_Conversion (Source => T2, Target => T3);
29
 
30
   C : constant T3 := T2_TO_T3 (S => (A => 0, B => 0));
31
 
32
   procedure Dummy is begin null; end;
33
 
34
end Unchecked_Convert8;

powered by: WebSVN 2.1.0

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