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/] [c3/] [c37005a.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
-- C37005A.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 SCALAR RECORD COMPONENTS MAY HAVE NON-STATIC
26
-- RANGE CONSTRAINTS OR DEFAULT INITIAL VALUES.
27
 
28
-- DAT 3/6/81
29
-- JWC 6/28/85   RENAMED TO -AB
30
-- EDS 7/16/98   AVOID OPTIMIZATION
31
 
32
WITH REPORT;
33
PROCEDURE C37005A IS
34
 
35
     USE REPORT;
36
 
37
BEGIN
38
     TEST ("C37005A", "SCALAR RECORD COMPONENTS MAY HAVE NON-STATIC"
39
                    & " RANGE CONSTRAINTS OR DEFAULT INITIAL VALUES");
40
 
41
     DECLARE
42
          SUBTYPE DT IS INTEGER RANGE IDENT_INT (1) .. IDENT_INT (5);
43
          L : INTEGER := IDENT_INT (DT'FIRST);
44
          R : INTEGER := IDENT_INT (DT'LAST);
45
          SUBTYPE DT2 IS INTEGER RANGE L .. R;
46
          M : INTEGER := (L + R) / 2;
47
 
48
          TYPE REC IS
49
               RECORD
50
                    C1 : INTEGER := M;
51
                    C2 : DT2 := (L + R) / 2;
52
                    C3 : BOOLEAN RANGE (L < M) .. (R > M)
53
                         := IDENT_BOOL (TRUE);
54
                    C4 : INTEGER RANGE L .. R := DT'FIRST;
55
               END RECORD;
56
 
57
          R1, R2 : REC := ((L+R)/2, M, M IN DT, L);
58
          R3 : REC;
59
     BEGIN
60
          IF R3 /= R1
61
          THEN
62
               FAILED ("INCORRECT RECORD VALUES");
63
          END IF;
64
 
65
          R3 := (R2.C2, R2.C1, R3.C3, R);  -- CONSTRAINTS CHECKED BY :=
66
          IF EQUAL(IDENT_INT(1), 2) THEN
67
               FAILED("IMPOSSIBLE " & INTEGER'IMAGE(R3.C1));  --USE R3
68
          END IF;
69
 
70
          BEGIN
71
               R3 := (M, M, IDENT_BOOL (FALSE), M); -- RAISES CON_ERR.
72
               FAILED ("CONSTRAINT ERROR NOT RAISED " & INTEGER'IMAGE(R3.C1));
73
          EXCEPTION
74
               WHEN CONSTRAINT_ERROR => NULL;
75
               WHEN OTHERS => FAILED ("WRONG EXCEPTION");
76
          END;
77
 
78
          FOR I IN DT LOOP
79
               R3 := (I, I, I /= 100, I);
80
               R1.C2 := I;
81
               IF EQUAL(IDENT_INT(1), 2) THEN
82
                    FAILED("IMPOSSIBLE " &
83
                           INTEGER'IMAGE(R3.C1 + R1.C2));  --USE R3, R1
84
               END IF;
85
          END LOOP;
86
 
87
     EXCEPTION
88
          WHEN OTHERS => FAILED ("INVALID EXCEPTION");
89
     END;
90
 
91
     RESULT;
92
END C37005A;

powered by: WebSVN 2.1.0

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