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/] [c4/] [c45262d.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C45262D.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 ORDERING COMPARISONS YIELD CORRECT RESULTS FOR
26
-- ONE-DIMENSIONAL DISCRETE ARRAY TYPES.  THIS TEST USES
27
-- USER-DEFINED ORDERING OPERATORS FOR THE DISCRETE COMPONENT TYPE.
28
 
29
-- JWC 8/19/85
30
 
31
WITH REPORT; USE REPORT;
32
 
33
PROCEDURE C45262D IS
34
 
35
     FUNCTION "<"(LEFT, RIGHT : INTEGER) RETURN BOOLEAN IS
36
     BEGIN
37
          RETURN STANDARD.">="(LEFT, RIGHT);
38
     END "<";
39
 
40
     FUNCTION "<="(LEFT, RIGHT : INTEGER) RETURN BOOLEAN IS
41
     BEGIN
42
          RETURN STANDARD.">"(LEFT, RIGHT);
43
     END "<=";
44
 
45
     FUNCTION ">"(LEFT, RIGHT : INTEGER) RETURN BOOLEAN IS
46
     BEGIN
47
          RETURN STANDARD."<="(LEFT, RIGHT);
48
     END ">";
49
 
50
     FUNCTION ">="(LEFT, RIGHT : INTEGER) RETURN BOOLEAN IS
51
     BEGIN
52
          RETURN STANDARD."<"(LEFT, RIGHT);
53
     END ">=";
54
 
55
BEGIN
56
     TEST ("C45262D", "ORDERING COMPARISONS OF ONE-DIMENSIONAL " &
57
                      "DISCRETE ARRAY TYPES");
58
 
59
     DECLARE
60
 
61
          SUBTYPE SUBINT IS INTEGER RANGE 0 .. 5;
62
          TYPE ARR IS ARRAY( SUBINT RANGE <> ) OF INTEGER;
63
          ARR1 : ARR(1 .. IDENT_INT(0));
64
          ARR2 : ARR(2 .. IDENT_INT(0));
65
          ARR3 : ARR(1 .. IDENT_INT(1)) := (IDENT_INT(1) => 0);
66
          ARR4 : ARR(0 .. IDENT_INT(0)) := (IDENT_INT(0) => 0);
67
          ARR5 : ARR(0 .. IDENT_INT(0)) := (IDENT_INT(0) => 1);
68
          ARR6 : ARR(1 .. IDENT_INT(5)) := (1 .. IDENT_INT(5) => 0);
69
          ARR7 : ARR(0 .. 4) := (0 .. 3 => 0, 4 => 1);
70
 
71
     BEGIN
72
 
73
          IF ARR1 < ARR2 THEN
74
               FAILED ("NULL ARRAYS ARR1 AND ARR2 NOT EQUAL - <");
75
          END IF;
76
 
77
          IF ARR3 <= ARR1 THEN
78
               FAILED ("NON-NULL ARRAY ARR3 LESS THAN EQUAL NULL " &
79
                       "ARR1");
80
          END IF;
81
 
82
          IF ARR3 > ARR4 THEN
83
               FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
84
                       "COMPONENTS EQUAL - >");
85
          END IF;
86
 
87
          IF NOT (ARR3(1) > ARR4(0)) THEN
88
               FAILED ("REDEFINED COMPONENT COMPARISON - >");
89
          END IF;
90
 
91
          IF ARR3 >= ARR5 THEN
92
               FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
93
                       "COMPONENTS NOT EQUAL - >=");
94
          END IF;
95
 
96
          IF NOT ( "<" (ARR6, ARR7) ) THEN
97
               FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
98
                       "MULTIPLE COMPONENTS, COMPONENTS NOT EQUAL - <");
99
          END IF;
100
 
101
     END;
102
 
103
     RESULT;
104
 
105
END C45262D;

powered by: WebSVN 2.1.0

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