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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c4/] [c46051b.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C46051B.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 ENUMERATION 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'.  CHANGED THE CODES IN SECOND
34
--                   ENUMERATION REPRESENTATION CLAUSE.
35
 
36
WITH REPORT; USE REPORT;
37
PROCEDURE C46051B IS
38
 
39
     TYPE ENUM IS (WE, LOVE, WRITING, TESTS);
40
 
41
     TYPE ENUM1 IS NEW ENUM;
42
     FOR ENUM1 USE
43
          (WE => -1, LOVE => 0, WRITING => 3, TESTS => 9);
44
 
45
     TYPE ENUM2 IS NEW ENUM;
46
     FOR ENUM2 USE
47
          (WE => 10, LOVE => 15, WRITING => 16, TESTS => 19);
48
 
49
     TYPE ENUM3 IS NEW ENUM1;
50
 
51
     E : ENUM := ENUM'VAL (IDENT_INT (0));
52
     E1 : ENUM1 := ENUM1'VAL (IDENT_INT (1));
53
     E2 : ENUM2 := ENUM2'VAL (IDENT_INT (2));
54
     E3 : ENUM3 := ENUM3'VAL (IDENT_INT (3));
55
 
56
BEGIN
57
     TEST ( "C46051B", "CHECK THAT ENUMERATION VALUES CAN BE " &
58
                       "CONVERTED IF THE OPERAND AND TARGET TYPES " &
59
                       "ARE RELATED BY DERIVATION, EVEN IF THE " &
60
                       "OPERAND AND TARGET TYPES HAVE DIFFERENT " &
61
                       "REPRESENTATIONS");
62
 
63
     IF ENUM1 (E) /= WE THEN
64
          FAILED ( "INCORRECT CONVERSION OF 'ENUM1 (E)'" );
65
     END IF;
66
 
67
     IF ENUM (E1) /= LOVE THEN
68
          FAILED ( "INCORRECT CONVERSION OF 'ENUM (E1)'" );
69
     END IF;
70
 
71
     IF ENUM1 (E2) /= WRITING THEN
72
          FAILED ( "INCORRECT CONVERSION OF 'ENUM1 (E2)'" );
73
     END IF;
74
 
75
     IF ENUM2 (E3) /= TESTS THEN
76
          FAILED ( "INCORRECT CONVERSION OF 'ENUM2 (E3)'" );
77
     END IF;
78
 
79
     IF ENUM (E) /= WE THEN
80
          FAILED ( "INCORRECT CONVERSION OF 'ENUM (E)'" );
81
     END IF;
82
 
83
     IF ENUM2 (E1) /= LOVE THEN
84
          FAILED ( "INCORRECT CONVERSION OF 'ENUM2 (E1)'" );
85
     END IF;
86
 
87
     IF ENUM3 (E2) /= WRITING THEN
88
          FAILED ( "INCORRECT CONVERSION OF 'ENUM3 (E2)'" );
89
     END IF;
90
 
91
     IF ENUM (E3) /= TESTS THEN
92
          FAILED ( "INCORRECT CONVERSION OF 'ENUM (E3)'" );
93
     END IF;
94
 
95
     RESULT;
96
 
97
EXCEPTION
98
     WHEN OTHERS =>
99
          FAILED ( "EXCEPTION RAISED DURING CONVERSION OF " &
100
                   "ENUMERATION TYPES" );
101
          RESULT;
102
END C46051B;

powered by: WebSVN 2.1.0

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