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/] [ada/] [acats/] [tests/] [c4/] [c46051c.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C46051C.ADA
2
 
3
--                             Grant of Unlimited Rights
4
--
5
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6
--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained 
7
--     unlimited rights in the software and documentation contained herein.
8
--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making 
9
--     this public release, the Government intends to confer upon all 
10
--     recipients unlimited rights  equal to those held by the Government.  
11
--     These rights include rights to use, duplicate, release or disclose the 
12
--     released technical data and computer software in whole or in part, in 
13
--     any manner and for any purpose whatsoever, and to have or permit others 
14
--     to do so.
15
--
16
--                                    DISCLAIMER
17
--
18
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED 
20
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE 
22
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23
--     PARTICULAR PURPOSE OF SAID MATERIAL.
24
--*
25
-- OBJECTIVE:
26
--     CHECK THAT RECORD VALUES CAN BE CONVERTED IF THE OPERAND
27
--     AND TARGET TYPES ARE RELATED BY DERIVATION, EVEN IF THE OPERAND
28
--     AND TARGET TYPES HAVE DIFFERENT REPRESENTATIONS.
29
 
30
-- HISTORY:
31
--     JET 07/13/88  CREATED ORIGINAL TEST.
32
--     RJW 08/28/89  REMOVED APPLICABILITY CRITERIA AND CHANGED
33
--                   EXTENSION TO 'ADA'.
34
 
35
WITH REPORT; USE REPORT;
36
WITH SYSTEM;
37
 
38
PROCEDURE C46051C IS
39
 
40
     UNITS_PER_INTEGER : CONSTANT :=
41
          (INTEGER'SIZE+SYSTEM.STORAGE_UNIT-1) / SYSTEM.STORAGE_UNIT;
42
 
43
     TYPE ARR IS ARRAY (1..2) OF INTEGER;
44
 
45
     TYPE REC IS RECORD
46
          F1 : INTEGER;
47
          F2 : INTEGER;
48
          F3 : INTEGER;
49
     END RECORD;
50
 
51
     TYPE REC1 IS NEW REC;
52
     FOR REC1 USE
53
          RECORD
54
               F1 AT 0 RANGE 0 .. INTEGER'SIZE - 1;
55
               F2 AT 1*UNITS_PER_INTEGER RANGE 0..INTEGER'SIZE - 1;
56
               F3 AT 3*UNITS_PER_INTEGER RANGE 0..INTEGER'SIZE - 1;
57
          END RECORD;
58
 
59
     TYPE REC2 IS NEW REC;
60
     FOR REC2 USE
61
          RECORD
62
               F1 AT 0 RANGE 0 .. INTEGER'SIZE - 1;
63
               F2 AT 2*UNITS_PER_INTEGER RANGE 0..INTEGER'SIZE - 1;
64
               F3 AT 3*UNITS_PER_INTEGER RANGE 0..INTEGER'SIZE - 1;
65
          END RECORD;
66
 
67
     TYPE REC3 IS NEW REC1;
68
 
69
     R  : REC  := (IDENT_INT (0), 1, 2);
70
     R1 : REC1 := (IDENT_INT (1), 2, 3);
71
     R2 : REC2 := (IDENT_INT (2), 3, 4);
72
     R3 : REC3 := (IDENT_INT (3), 4, 5);
73
 
74
BEGIN
75
     TEST ( "C46051C", "CHECK THAT RECORD VALUES CAN BE " &
76
                       "CONVERTED IF THE OPERAND AND TARGET TYPES " &
77
                       "ARE RELATED BY DERIVATION, EVEN IF THE " &
78
                       "OPERAND AND TARGET TYPES HAVE DIFFERENT " &
79
                       "REPRESENTATIONS");
80
 
81
     IF REC1(R) /= (0,1,2) THEN
82
          FAILED ( "INCORRECT CONVERSION OF 'REC1 (R)'" );
83
     END IF;
84
 
85
     IF REC (R1) /= (1,2,3) THEN
86
          FAILED ( "INCORRECT CONVERSION OF 'REC (R1)'" );
87
     END IF;
88
 
89
     IF REC1 (R2) /= (2,3,4) THEN
90
          FAILED ( "INCORRECT CONVERSION OF 'REC1 (R2)'" );
91
     END IF;
92
 
93
     IF REC2 (R3) /= (3,4,5) THEN
94
          FAILED ( "INCORRECT CONVERSION OF 'REC2 (R3)'" );
95
     END IF;
96
 
97
     IF REC (R) /= (0,1,2) THEN
98
          FAILED ( "INCORRECT CONVERSION OF 'REC (R)'" );
99
     END IF;
100
 
101
     IF REC2 (R1) /= (1,2,3) THEN
102
          FAILED ( "INCORRECT CONVERSION OF 'REC2 (R1)'" );
103
     END IF;
104
 
105
     IF REC3 (R2) /= (2,3,4) THEN
106
          FAILED ( "INCORRECT CONVERSION OF 'REC3 (R2)'" );
107
     END IF;
108
 
109
     IF REC (R3) /= (3,4,5) THEN
110
          FAILED ( "INCORRECT CONVERSION OF 'REC (R3)'" );
111
     END IF;
112
 
113
     RESULT;
114
 
115
EXCEPTION
116
     WHEN OTHERS =>
117
          FAILED ( "EXCEPTION RAISED DURING CONVERSION OF " &
118
                   "RECORD TYPES" );
119
          RESULT;
120
END C46051C;

powered by: WebSVN 2.1.0

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