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/] [c9/] [c96005b.tst] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C96005B.TST
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 THE CORRECTNESS OF THE ADDITION AND SUBTRACTION FUNCTIONS IN
26
-- THE PREDEFINED PACKAGE CALENDAR, AND APPROPRIATE EXCEPTION HANDLING.
27
-- SPECIFICALLY,
28
--   (B) ADDITION AND SUBTRACTION OPERATORS RAISE CONSTRAINT_ERROR WHEN
29
--       CALLED WITH AN OUT OF RANGE DURATION PARAMETER.
30
 
31
-- CPP 8/16/84
32
 
33
WITH CALENDAR;  USE CALENDAR;
34
WITH REPORT;  USE REPORT;
35
PROCEDURE C96005B IS
36
 
37
BEGIN
38
     TEST ("C96005B", "CHECK THAT ADDITION AND SUBTRACTION " &
39
           "OPERATORS RAISE CONSTRAINT_ERROR WHEN CALLED WITH " &
40
           "OUT OF RANGE DURATION PARAMETER");
41
 
42
     -----------------------------------------------
43
 
44
     BEGIN     -- (B)
45
 
46
          -- ADDITION TESTS FOLLOW.
47
          DECLARE
48
               BEFORE : TIME := CLOCK;
49
          BEGIN
50
               IF DURATION'BASE'FIRST < DURATION'FIRST THEN
51
                    COMMENT("LOW VALUES EXIST - (B)1");
52
                    BEFORE := BEFORE + ($LESS_THAN_DURATION);
53
                    FAILED ("EXCEPTION NOT RAISED - (B)1");
54
               ELSE
55
                    NOT_APPLICABLE ("NO LOW VALUES EXIST - (B)1");
56
               END IF;
57
          EXCEPTION
58
               WHEN CONSTRAINT_ERROR =>
59
                    NULL;
60
               WHEN TIME_ERROR =>
61
                    FAILED ("TIME_ERROR RAISED INSTEAD OF " &
62
                            "CONSTRAINT_ERROR - (B)1");
63
               WHEN OTHERS =>
64
                    FAILED ("WRONG EXCEPTION RAISED - (B)1");
65
          END;
66
 
67
          DECLARE
68
               BEFORE : TIME := CLOCK;
69
          BEGIN
70
               IF DURATION'LAST < DURATION'BASE'LAST THEN
71
                    COMMENT("HIGH VALUES EXIST - (B)2");
72
                    BEFORE := $GREATER_THAN_DURATION + BEFORE;
73
                    FAILED ("EXCEPTION NOT RAISED - (B)2");
74
               ELSE
75
                    NOT_APPLICABLE ("NO HIGH VALUES EXIST - (B)2");
76
               END IF;
77
          EXCEPTION
78
               WHEN CONSTRAINT_ERROR =>
79
                    NULL;
80
               WHEN TIME_ERROR =>
81
                    FAILED ("TIME_ERROR RAISED INSTEAD OF " &
82
                            "CONSTRAINT_ERROR - (B)2");
83
               WHEN OTHERS =>
84
                    FAILED ("WRONG EXCEPTION RAISED - (B)2");
85
          END;
86
 
87
 
88
          -- SUBTRACTION TESTS FOLLOW.
89
          DECLARE
90
               BEFORE : TIME := CLOCK;
91
          BEGIN
92
               IF DURATION'BASE'FIRST < DURATION'FIRST THEN
93
                    COMMENT("LOW VALUES EXIST - (B)3");
94
                    BEFORE := BEFORE - ($LESS_THAN_DURATION);
95
                    FAILED ("EXCEPTION NOT RAISED - (B)3");
96
               ELSE
97
                    NOT_APPLICABLE ("NO LOW VALUES EXIST - (B)3");
98
               END IF;
99
          EXCEPTION
100
               WHEN CONSTRAINT_ERROR =>
101
                    NULL;
102
               WHEN TIME_ERROR =>
103
                    FAILED ("TIME_ERROR RAISED INSTEAD OF " &
104
                            "CONSTRAINT_ERROR - (B)3");
105
               WHEN OTHERS =>
106
                    FAILED ("WRONG EXCEPTION RAISED - (B)3");
107
          END;
108
 
109
          DECLARE
110
               BEFORE : TIME := CLOCK;
111
          BEGIN
112
               IF DURATION'LAST < DURATION'BASE'LAST THEN
113
                    COMMENT("HIGH VALUES EXIST - (B)4");
114
                    BEFORE := BEFORE - $GREATER_THAN_DURATION;
115
                    FAILED ("EXCEPTION NOT RAISED - (B)4");
116
               ELSE
117
                    NOT_APPLICABLE ("NO HIGH VALUES EXIST - (B)4");
118
               END IF;
119
          EXCEPTION
120
               WHEN CONSTRAINT_ERROR =>
121
                    NULL;
122
               WHEN TIME_ERROR =>
123
                    FAILED ("TIME_ERROR RAISED INSTEAD OF " &
124
                            "CONSTRAINT_ERROR - (B)4");
125
               WHEN OTHERS =>
126
                    FAILED ("WRONG EXCEPTION RAISED - (B)4");
127
          END;
128
 
129
 
130
     END; -- (B)
131
 
132
     -----------------------------------------------
133
 
134
     RESULT;
135
END C96005B;

powered by: WebSVN 2.1.0

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