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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c3/] [c35508k.ada] - Blame information for rev 750

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

Line No. Rev Author Line
1 720 jeremybenn
-- C35508K.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 'POS' AND 'VAL' YIELD THE CORRECT RESULTS WHEN THE 
26
-- PREFIX IS A BOOLEAN TYPE.
27
 
28
-- RJW 3/19/86
29
-- PWN 01/31/95  REMOVED INCONSISTENCIES WITH ADA 9X.
30
 
31
WITH REPORT; USE REPORT;
32
 
33
PROCEDURE C35508K IS
34
 
35
     TYPE NEWBOOL IS NEW BOOLEAN;
36
 
37
BEGIN
38
     TEST ("C35508K", "CHECK THAT 'POS' AND 'VAL' YIELD THE " &
39
                      "CORRECT RESULTS  WHEN THE PREFIX IS A " &
40
                      "BOOLEAN TYPE" );
41
 
42
     BEGIN
43
          IF BOOLEAN'POS (IDENT_BOOL(FALSE)) /= 0 THEN
44
               FAILED ( "WRONG POS FOR 'FALSE'" );
45
          END IF;
46
          IF BOOLEAN'POS (IDENT_BOOL(TRUE)) /= 1 THEN
47
               FAILED ( "WRONG POS FOR 'TRUE'" );
48
          END IF;
49
 
50
          IF BOOLEAN'VAL (IDENT_INT(0)) /= FALSE THEN
51
               FAILED ( "WRONG VAL FOR '0'" );
52
          END IF;
53
          IF BOOLEAN'VAL (IDENT_INT(1)) /= TRUE THEN
54
               FAILED ( "WRONG VAL FOR '1'" );
55
          END IF;
56
     END;
57
 
58
     BEGIN
59
          IF BOOLEAN'VAL (IDENT_INT(-1)) = TRUE THEN
60
               FAILED("'VAL(-1) WRAPPED AROUND TO TRUE");
61
          END IF;
62
          FAILED ( "NO EXCEPTION RAISED FOR VAL OF '-1'" );
63
     EXCEPTION
64
          WHEN CONSTRAINT_ERROR =>
65
               NULL;
66
          WHEN OTHERS =>
67
               FAILED ( "WRONG EXCEPTION RAISED FOR VAL OF '-1'" );
68
     END;
69
 
70
     BEGIN
71
          IF BOOLEAN'VAL (IDENT_INT(2)) = FALSE THEN
72
               FAILED("BOOLEAN'VAL(2) WRAPPED AROUND TO FALSE");
73
          END IF;
74
          FAILED ( "NO EXCEPTION RAISED FOR VAL OF '2'" );
75
     EXCEPTION
76
          WHEN CONSTRAINT_ERROR =>
77
               NULL;
78
          WHEN OTHERS =>
79
               FAILED ( "WRONG EXCEPTION RAISED FOR VAL OF '2'" );
80
     END;
81
 
82
     BEGIN
83
          IF NEWBOOL'POS (FALSE) /= 0 THEN
84
               FAILED ( "WRONG POS FOR NEWBOOL'(FALSE)" );
85
          END IF;
86
          IF NEWBOOL'POS (TRUE) /= 1 THEN
87
               FAILED ( "WRONG POS FOR NEWBOOL'(TRUE)" );
88
          END IF;
89
 
90
          IF NEWBOOL'VAL (0) /= FALSE THEN
91
               FAILED ( "WRONG NEWBOOL'VAL FOR '0'" );
92
          END IF;
93
          IF NEWBOOL'VAL (1) /= TRUE THEN
94
               FAILED ( "WRONG NEWBOOL'VAL FOR '1'" );
95
          END IF;
96
     END;
97
 
98
     BEGIN
99
          IF NEWBOOL'VAL (IDENT_INT(-1)) = TRUE THEN
100
               FAILED("NEWBOOL'VAL(-1) WRAPPED AROUND TO TRUE");
101
          END IF;
102
          FAILED ( "NO EXCEPTION RAISED FOR NEWBOOL'VAL OF '-1'" );
103
     EXCEPTION
104
          WHEN CONSTRAINT_ERROR =>
105
               NULL;
106
          WHEN OTHERS =>
107
               FAILED ( "WRONG EXCEPTION RAISED FOR " &
108
                        "NEWBOOL'VAL OF '-1'" );
109
     END;
110
 
111
     BEGIN
112
          IF NEWBOOL'VAL (IDENT_INT(2)) = FALSE THEN
113
               FAILED("NEWBOOL'VAL(2) WRAPPED AROUND TO FALSE");
114
          END IF;
115
          FAILED ( "NO EXCEPTION RAISED FOR NEWBOOL'VAL OF '2'" );
116
     EXCEPTION
117
          WHEN CONSTRAINT_ERROR =>
118
               NULL;
119
          WHEN OTHERS =>
120
               FAILED ( "WRONG EXCEPTION RAISED FOR " &
121
                        "NEWBOOL'VAL OF '2'" );
122
     END;
123
 
124
     RESULT;
125
END C35508K;

powered by: WebSVN 2.1.0

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