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

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

Line No. Rev Author Line
1 294 jeremybenn
-- CD4031A.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 WHEN A RECORD REPRESENTATION CLAUSE IS GIVEN FOR A
27
--     VARIANT RECORD TYPE, THEN COMPONENTS BELONGING TO DIFFERENT
28
--     VARIANTS CAN BE GIVEN OVERLAPPING STORAGE.
29
 
30
-- HISTORY:
31
--     PWB 07/22/87  CREATED ORIGINAL TEST.
32
--     DHH 03/27/89  CHANGED EXTENSION FROM '.DEP' TO '.ADA' AND
33
--                   ADDED CHECK FOR REPRESENTATION CLAUSE.
34
--     RJW 06/12/90  REMOVED REFERENCES TO LENGTH_CHECK.  REVISED
35
--                   COMMENTS.
36
--     JRL 10/13/96  Adjusted ranges in type definitions to allow 1's
37
--                   complement machines to represent all values in
38
--                   the specified number of bits.
39
 
40
WITH REPORT; USE REPORT;
41
PROCEDURE CD4031A IS
42
 
43
     TYPE DISCRIMINAN IS RANGE -1 .. 1;
44
     TYPE INT IS RANGE -3 .. 3;
45
     TYPE LARGE_INT IS RANGE -7 .. 7;
46
 
47
     TYPE TEST_CLAUSE (DISC : DISCRIMINAN := 0) IS
48
          RECORD
49
               CASE DISC IS
50
                    WHEN 0 =>
51
                         INTEGER_COMP : LARGE_INT;
52
                    WHEN OTHERS  =>
53
                         CH_COMP_1 : INT;
54
                         CH_COMP_2 : INT;
55
               END CASE;
56
          END RECORD;
57
 
58
     FOR TEST_CLAUSE USE
59
          RECORD
60
               DISC AT 0
61
                           RANGE 0 .. 1;
62
               INTEGER_COMP AT 0
63
                           RANGE 2 .. 5;
64
               CH_COMP_1 AT 0
65
                           RANGE 2 .. 4;
66
               CH_COMP_2 AT 0
67
                           RANGE 5 .. 7;
68
          END RECORD;
69
 
70
     TYPE TEST_CL1 IS NEW TEST_CLAUSE(DISC => 0);
71
     TYPE TEST_CL2 IS NEW TEST_CLAUSE(DISC => 1);
72
     TEST_RECORD : TEST_CL1;
73
     TEST_RECORD1 : TEST_CL2;
74
 
75
     INTEGER_COMP_FIRST,
76
     CH_COMP_1_FIRST : INTEGER;
77
 
78
BEGIN
79
     TEST ("CD4031A", "IN RECORD REPRESENTATION CLAUSES " &
80
                      "FOR VARIANT RECORD TYPES, " &
81
                      "COMPONENTS OF DIFFERENT VARIANTS " &
82
                      "CAN BE GIVEN OVERLAPPING STORAGE");
83
 
84
     TEST_RECORD := (0, -7);
85
     INTEGER_COMP_FIRST := TEST_RECORD.INTEGER_COMP'FIRST_BIT;
86
 
87
     TEST_RECORD1 := (1, -3, -3);
88
     CH_COMP_1_FIRST := TEST_RECORD1.CH_COMP_1'FIRST_BIT;
89
 
90
     IF INTEGER_COMP_FIRST /= CH_COMP_1_FIRST THEN
91
          FAILED ("COMPONENTS DO NOT BEGIN AT SAME POINT");
92
     END IF;
93
 
94
     RESULT;
95
END CD4031A;

powered by: WebSVN 2.1.0

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