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/] [cd/] [cd4051a.ada] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
-- CD4051A.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 A RECORD REPRESENTATION CLAUSE CAN BE GIVEN FOR
27
--     DERIVED TYPES WHOSE PARENT TYPES ARE RECORD TYPES WITHOUT
28
--     DISCRIMINANTS.
29
 
30
-- HISTORY:
31
--     BCB 03/20/89  CHANGED EXTENSION FROM '.ADA' TO '.DEP'.
32
--     RJW 08/25/87  CREATED ORIGINAL TEST.
33
 
34
WITH REPORT; USE REPORT;
35
WITH SYSTEM;
36
PROCEDURE CD4051A IS
37
 
38
     UNITS_PER_INTEGER : CONSTANT :=
39
                      (INTEGER'SIZE + SYSTEM.STORAGE_UNIT - 1) /
40
                      SYSTEM.STORAGE_UNIT;
41
 
42
     TYPE BASIC_CLAUSE IS RECORD
43
          INT_COMP    : INTEGER;
44
          CHAR_COMP   : CHARACTER;
45
     END RECORD;
46
 
47
     TYPE CHECK_CLAUSE IS NEW BASIC_CLAUSE;
48
 
49
     FOR CHECK_CLAUSE USE
50
          RECORD
51
               INT_COMP AT 0
52
                           RANGE 0..INTEGER'SIZE - 1;
53
               CHAR_COMP AT 1*UNITS_PER_INTEGER
54
                           RANGE 0..CHARACTER'SIZE - 1;
55
          END RECORD;
56
 
57
     CHECK_RECORD : CHECK_CLAUSE := (1, 'A');
58
 
59
BEGIN
60
     TEST ("CD4051A", "CHECK THAT A RECORD REPRESENTATION " &
61
                      "CLAUSE CAN BE GIVEN FOR A DERIVED TYPE " &
62
                      "WHOSE PARENT TYPE IS IS A RECORD TYPE " &
63
                      "WITHOUT DISCRIMINANTS");
64
 
65
     IF CHECK_RECORD.INT_COMP'FIRST_BIT /= 0 THEN
66
          FAILED ("INCORRECT VALUE FOR FIRST_BIT OF INT_COMP");
67
     END IF;
68
 
69
     IF CHECK_RECORD.INT_COMP'LAST_BIT /= INTEGER'SIZE - 1 THEN
70
          FAILED ("INCORRECT VALUE FOR LAST_BIT OF INT_COMP");
71
     END IF;
72
 
73
     IF CHECK_RECORD.INT_COMP'POSITION /= 0 THEN
74
          FAILED ("INCORRECT VALUE FOR POSITION OF INT_COMP");
75
     END IF;
76
 
77
     IF CHECK_RECORD.CHAR_COMP'FIRST_BIT /= IDENT_INT (0) THEN
78
          FAILED ("INCORRECT VALUE FOR FIRST_BIT OF CHAR_COMP");
79
     END IF;
80
 
81
     IF CHECK_RECORD.CHAR_COMP'LAST_BIT /=
82
               IDENT_INT (CHARACTER'SIZE - 1) THEN
83
          FAILED ("INCORRECT VALUE FOR LAST_BIT OF CHAR_COMP");
84
     END IF;
85
 
86
     IF CHECK_RECORD.CHAR_COMP'POSITION /=
87
               IDENT_INT (UNITS_PER_INTEGER) THEN
88
          FAILED ("INCORRECT VALUE FOR POSITION OF CHAR_COMP");
89
     END IF;
90
 
91
     RESULT;
92
END CD4051A;

powered by: WebSVN 2.1.0

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