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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c4/] [c47002a.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- C47002A.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
-- CHECK THAT VALUES BELONGING TO EACH CLASS OF TYPE CAN BE WRITTEN AS 
26
-- THE OPERANDS OF QUALIFIED EXPRESSIONS.
27
-- THIS TEST IS FOR DISCRETE TYPES.
28
 
29
-- RJW 7/23/86
30
 
31
WITH REPORT; USE REPORT;
32
PROCEDURE C47002A IS
33
 
34
BEGIN
35
 
36
     TEST( "C47002A", "CHECK THAT VALUES HAVING DISCRETE TYPES " &
37
                      "CAN BE WRITTEN AS THE OPERANDS OF " &
38
                      "QUALIFIED EXPRESSIONS" );
39
 
40
     DECLARE  -- ENUMERATION TYPES.
41
 
42
          TYPE WEEK IS (SUN, MON, TUE, WED, THU, FRI, SAT);
43
          TYPE WEEKEND IS (SAT, SUN);
44
 
45
          TYPE CHAR IS ('B', 'A');
46
 
47
          TYPE MYBOOL IS (TRUE, FALSE);
48
 
49
          TYPE NBOOL IS NEW BOOLEAN;
50
 
51
     BEGIN
52
          IF WEEKEND'(SAT) >= SUN THEN
53
               FAILED ( "INCORRECT RESULTS FOR TYPE WEEKEND" );
54
          END IF;
55
 
56
          IF CHAR'('B') >= 'A' THEN
57
               FAILED ( "INCORRECT RESULTS FOR TYPE CHAR" );
58
          END IF;
59
 
60
          IF MYBOOL'(TRUE) >= FALSE THEN
61
               FAILED ( "INCORRECT RESULTS FOR TYPE MYBOOL" );
62
          END IF;
63
 
64
          IF NBOOL'(TRUE) <= FALSE THEN
65
               FAILED ( "INCORRECT RESULTS FOR TYPE NBOOL" );
66
          END IF;
67
     END;
68
 
69
     DECLARE -- INTEGER TYPES.
70
 
71
          TYPE RESULTS IS (INT1, INT2, INT3);
72
 
73
          TYPE NEWINT IS NEW INTEGER;
74
 
75
          TYPE INT IS RANGE -10 .. 10;
76
 
77
          FUNCTION F (I : NEWINT) RETURN RESULTS IS
78
          BEGIN
79
               RETURN INT1;
80
          END F;
81
 
82
          FUNCTION F (I : INT) RETURN RESULTS IS
83
          BEGIN
84
               RETURN INT2;
85
          END F;
86
 
87
          FUNCTION F (I : INTEGER) RETURN RESULTS IS
88
          BEGIN
89
               RETURN INT3;
90
          END F;
91
 
92
     BEGIN
93
          IF F (NEWINT'(5)) /= INT1 THEN
94
               FAILED ( "INCORRECT RESULTS FOR TYPE NEWINT" );
95
          END IF;
96
 
97
          IF F (INT'(5)) /= INT2 THEN
98
               FAILED ( "INCORRECT RESULTS FOR TYPE INT" );
99
          END IF;
100
 
101
          IF F (INTEGER'(5)) /= INT3 THEN
102
               FAILED ( "INCORRECT RESULTS FOR TYPE INTEGER" );
103
          END IF;
104
     END;
105
 
106
     RESULT;
107
END C47002A;

powered by: WebSVN 2.1.0

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