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/] [c8/] [c83b02b.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C83B02B.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 NON-NESTED LOOPS CAN HAVE IDENTICALLY NAMED PARAMETERS,
26
--    AND REFERENCES IN EACH LOOP ARE ASSOCIATED WITH THAT LOOP'S
27
--    LOOP PARAMETER.  (THIS IS PART  B  OF THE OBJECTIVE.)
28
-- CHECK ALSO THAT A LOOP PARAMETER CAN HAVE THE SAME IDENTIFIER
29
--    AS A VARIABLE DECLARED IN THE SCOPE IMMEDIATELY CONTAINING
30
--    THE LOOP.  (THIS IS PART  C  OF THE OBJECTIVE.)
31
 
32
 
33
 
34
--    RM     6 JUNE 1980
35
 
36
 
37
WITH REPORT;
38
PROCEDURE  C83B02B  IS
39
 
40
     USE REPORT;
41
 
42
     I , J : INTEGER := 1 ;
43
 
44
BEGIN
45
 
46
     TEST ( "C83B02B" ,
47
            "CHECK THAT NON-NESTED LOOPS CAN HAVE IDENTICALLY NAMED" &
48
            " PARAMETERS" );
49
 
50
     COMMENT ( "THE NAME MAY BE THE SAME AS THAT OF A VARIABLE" &
51
               " KNOWN OUTSIDE THE LOOP" );
52
 
53
     -- CHECK PART B OF THE OBJECTIVE
54
     DECLARE
55
          TYPE  WEEKDAY  IS  ( MON , TUE , WED , THU , FRI );
56
     BEGIN
57
 
58
          FOR  LOOP_PAR  IN  3..3  LOOP
59
               I := I * LOOP_PAR ;              --    3
60
          END LOOP;
61
 
62
          FOR  LOOP_PAR  IN  FRI..FRI  LOOP
63
               I := I * WEEKDAY'POS(LOOP_PAR) ; --   12
64
          END LOOP;
65
 
66
          FOR  LOOP_PAR  IN  7..7  LOOP
67
               I := I * LOOP_PAR ;              --  84
68
          END LOOP;
69
 
70
     END;
71
 
72
     IF I /= 84 THEN
73
          FAILED ("DID NOT ACCESS ENCLOSING IDENTICALLY NAMED " &
74
                  "LOOP PARAMETER IN NON-NESTED LOOPS");
75
     END IF;
76
 
77
     -- CHECK PART C OF THE OBJECTIVE
78
     DECLARE
79
          LOOP_PAR : INTEGER := 2 ;
80
     BEGIN
81
 
82
          J := J * LOOP_PAR ;                          --    2
83
 
84
          FOR  LOOP_PAR  IN  3..3  LOOP
85
               J := J * LOOP_PAR ;                     --    6
86
          END LOOP;
87
 
88
          J := J * LOOP_PAR ;                          --   12
89
 
90
          FOR  LOOP_PAR  IN  5..5  LOOP
91
               J := J * LOOP_PAR ;                     --   60
92
          END LOOP;
93
 
94
          J := J * LOOP_PAR ;                          --  120
95
 
96
          FOR  LOOP_PAR  IN  7..7  LOOP
97
               J := J * LOOP_PAR ;                     --  840
98
          END LOOP;
99
 
100
          J := J * LOOP_PAR ;                          -- 1680
101
 
102
     END;
103
 
104
     IF J /= 1680 THEN
105
          FAILED ("DID NOT ACCESS IDENTICALLY NAMED LOOP PARAMETER " &
106
                  "INSIDE NON-NESTED LOOPS OR IDENTICALLY NAMED " &
107
                  "VARIABLE OUTSIDE LOOPS");
108
     END IF;
109
 
110
     RESULT;
111
 
112
END C83B02B;

powered by: WebSVN 2.1.0

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