OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c4/] [c49024a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C49024A.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 A FUNCTION CALL CAN APPEAR IN A STATIC EXPRESSION IF THE
26
-- FUNCTION NAME DENOTES A PREDEFINED OPERATOR AND HAS THE FORM OF AN
27
-- OPERATOR SYMBOL OR AN EXPANDED NAME WHOSE SELECTOR IS AN OPERATOR
28
-- SYMBOL.
29
 
30
-- L.BROWN  10/02/86
31
 
32
WITH REPORT; USE REPORT;
33
PROCEDURE  C49024A  IS
34
 
35
     PACKAGE P IS
36
          TYPE TY IS NEW INTEGER;
37
     END P;
38
 
39
     CON1 : CONSTANT P.TY := 3;
40
     CON2 : CONSTANT P.TY := 4;
41
     TYPE INT1 IS RANGE 1 .. P."+"(CON1,CON2);
42
     CON3 : CONSTANT := 5;
43
     CON4 : CONSTANT := 7;
44
     TYPE FLT IS DIGITS "-"(CON4,CON3);
45
     TYPE FIX1 IS DELTA 1.0 RANGE 0.0 .. 25.0;
46
     CON5 : CONSTANT := 3.0;
47
     CON6 : CONSTANT := 6.0;
48
     TYPE FIX2 IS DELTA 1.0 RANGE 0.0 .. "/"(CON6,CON5);
49
     TYPE ENUM IS (RED,BLUE,GREEN,BLACK);
50
     CON7 : CONSTANT BOOLEAN := TRUE;
51
     CON8 : CONSTANT ENUM := BLUE;
52
     CAS_INT1 : CONSTANT := 10;
53
     CAS_INT2 : CONSTANT := 2;
54
     OBJ1 : INTEGER := 10;
55
     CAS_BOL : BOOLEAN := TRUE;
56
     CON9 : CONSTANT ENUM := BLACK;
57
     CON10 : CONSTANT FIX1 := 2.0;
58
     CON11 : CONSTANT FIX1 := 10.0;
59
     TYPE FIX3 IS DELTA "+"(CON10) RANGE 0.0 .. 20.0;
60
     TYPE INT2 IS RANGE 0 .. "ABS"("-"(CON4));
61
     CON12 : CONSTANT CHARACTER := 'D';
62
     CON13 : CONSTANT CHARACTER := 'B';
63
     CON14 : CONSTANT BOOLEAN := FALSE;
64
     CON15 : CONSTANT := 10;
65
 
66
BEGIN
67
 
68
     TEST("C49024A","A FUNCTION CALL CAN BE IN A STATIC EXPRESSION "&
69
                    "IF THE FUNCTION NAME DENOTES A PREDEFINED "&
70
                    "OPERATOR AND HAS THE FORM OF AN OPERATOR SYMBOL");
71
 
72
     CASE CAS_BOL IS
73
          WHEN ("NOT"(CON7)) =>
74
               FAILED("INCORRECT VALUE RETURNED FOR STATIC "&
75
                      "OPERATORS 1");
76
          WHEN ("/="(CON8,CON9)) =>
77
               OBJ1 := 2;
78
     END CASE;
79
     CAS_BOL := TRUE;
80
 
81
     CASE CAS_BOL IS
82
          WHEN ("*"(CON3,CON4) = CAS_INT1) =>
83
               FAILED("INCORRECT VALUE RETURNED FOR STATIC "&
84
                      "OPERATORS 2");
85
          WHEN ("ABS"(CON15) = CAS_INT1) =>
86
               OBJ1 := 3;
87
     END CASE;
88
     CAS_BOL := TRUE;
89
 
90
     CASE CAS_BOL IS
91
          WHEN ("<"(CON11,CON10)) =>
92
               FAILED("INCORRECT VALUE RETURNED FOR STATIC "&
93
                      "OPERATORS 3");
94
          WHEN ("<="(CON13,CON12)) =>
95
               OBJ1 := 4;
96
     END CASE;
97
     CAS_BOL := TRUE;
98
 
99
     CASE CAS_BOL IS
100
          WHEN ("REM"(CON4,CON3) = CAS_INT2) =>
101
               OBJ1 := 5;
102
          WHEN ("**"(CON3,CON4) = CAS_INT2) =>
103
               FAILED("INCORRECT VALUE RETURNED FOR STATIC "&
104
                      "OPERATORS 4");
105
     END CASE;
106
 
107
     CASE CAS_BOL IS
108
          WHEN (P.">"(CON1,CON2)) =>
109
               FAILED("INCORRECT VALUE RETURNED FOR STATIC "&
110
                      "OPERATORS 5");
111
          WHEN ("OR"(CON7,CON14)) =>
112
               OBJ1 := 6;
113
     END CASE;
114
     CAS_BOL := TRUE;
115
 
116
     CASE CAS_BOL IS
117
          WHEN ("MOD"(CON4,CON3) = CAS_INT2) =>
118
               OBJ1 := 7;
119
          WHEN ("ABS"(CON4) = CAS_INT2) =>
120
               FAILED("INCORRECT VALUE RETURNED FOR STATIC "&
121
                      "OPERATORS 6");
122
     END CASE;
123
 
124
     CASE CAS_BOL IS
125
          WHEN ("AND"(CON7,CON14)) =>
126
               FAILED("INCORRECT VALUE RETURNED FOR STATIC "&
127
                      "OPERATORS 7");
128
          WHEN (">="(CON12,CON13)) =>
129
               OBJ1 := 9;
130
     END CASE;
131
 
132
     RESULT;
133
 
134
END C49024A;

powered by: WebSVN 2.1.0

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