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/] [c8/] [c87b19a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C87B19A.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 OVERLOADING RESOLUTION USES THE RULE THAT:
27
--
28
--     SIMPLE EXPRESSIONS AND RANGE BOUNDS OF VARIANT CHOICES MUST MATCH
29
--     THE TYPE OF THE DISCRIMINANT'S EXPLICIT TYPEMARK.
30
 
31
--HISTORY:
32
--     DSJ 06/15/83 CREATED ORIGINAL TEST.
33
--     DHH 10/20/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS.
34
 
35
WITH REPORT; USE REPORT;
36
 
37
PROCEDURE C87B19A IS
38
 
39
     TYPE COLOR  IS (YELLOW, RED, BLUE, GREEN, BROWN);
40
     TYPE SCHOOL IS (YALE, HARVARD, PRINCETON, BROWN, STANFORD);
41
     TYPE COOK   IS (BROIL, BAKE, BROWN, TOAST, FRY);
42
     TYPE MIXED  IS (GREEN, BROWN, YALE, BAKE, BLUE, FRY);
43
 
44
     RATING : INTEGER := 0;
45
 
46
     FUNCTION OK RETURN BOOLEAN IS
47
     BEGIN
48
          RATING := RATING + 1;
49
          RETURN FALSE;
50
     END OK;
51
 
52
     FUNCTION ERR RETURN BOOLEAN IS
53
     BEGIN
54
          FAILED ("VARIANT CHOICES MUST MATCH TYPE OF DISCRIMINANT");
55
          RETURN FALSE;
56
     END ERR;
57
 
58
BEGIN
59
     TEST ("C87B19A","OVERLOADED EXPRESSIONS AND RANGE BOUNDS" &
60
           " OF VARIANT CHOICES");
61
     DECLARE
62
 
63
          TYPE REC (X : MIXED := BROWN) IS
64
               RECORD
65
                    CASE X IS
66
                         WHEN GREEN .. BROWN  => NULL;
67
                         WHEN BLUE            => NULL;
68
                         WHEN FRY             => NULL;
69
                         WHEN YALE            => NULL;
70
                         WHEN OTHERS          => NULL;
71
                    END CASE;
72
               END RECORD;
73
 
74
          R1 : REC (X => FRY);
75
          R2 : REC (X => BLUE);
76
          R3 : REC (X => BAKE);
77
          R4 : REC (X => YALE);
78
          R5 : REC (X => BROWN);
79
          R6 : REC (X => GREEN);
80
 
81
     BEGIN
82
          IF MIXED'POS(R1.X) /= 5 THEN
83
             FAILED ("VARIANT CHOICES MUST MATCH TYPE OF " &
84
                     "DISCRIMINANT-R1");
85
          END IF;
86
          IF MIXED'POS(R2.X) /= 4 THEN
87
             FAILED ("VARIANT CHOICES MUST MATCH TYPE OF " &
88
                     "DISCRIMINANT-R2");
89
          END IF;
90
          IF MIXED'POS(R3.X) /= 3 THEN
91
             FAILED ("VARIANT CHOICES MUST MATCH TYPE OF " &
92
                     "DISCRIMINANT-R3");
93
          END IF;
94
          IF MIXED'POS(R4.X) /= 2 THEN
95
             FAILED ("VARIANT CHOICES MUST MATCH TYPE OF " &
96
                     "DISCRIMINANT-R4");
97
          END IF;
98
          IF MIXED'POS(R5.X) /= 1 THEN
99
             FAILED ("VARIANT CHOICES MUST MATCH TYPE OF " &
100
                     "DISCRIMINANT-R5");
101
          END IF;
102
          IF MIXED'POS(R6.X) /= 0 THEN
103
             FAILED ("VARIANT CHOICES MUST MATCH TYPE OF " &
104
                     "DISCRIMINANT-R6");
105
          END IF;
106
 
107
     END;
108
 
109
     RESULT;
110
END C87B19A;

powered by: WebSVN 2.1.0

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