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/] [c5/] [c53007a.ada] - Blame information for rev 316

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C53007A.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 CONTROL FLOWS CORRECTLY IN SIMPLE NESTED IF_STATEMENTS.
26
 
27
-- JRK 7/23/80
28
-- SPS 3/4/83
29
 
30
WITH REPORT;
31
PROCEDURE C53007A IS
32
 
33
     USE REPORT;
34
 
35
     CI1 : CONSTANT INTEGER := 1;
36
     CI9 : CONSTANT INTEGER := 9;
37
     CBT : CONSTANT BOOLEAN := TRUE;
38
     CBF : CONSTANT BOOLEAN := FALSE;
39
 
40
     VI1 : INTEGER := IDENT_INT(1);
41
     VI9 : INTEGER := IDENT_INT(9);
42
     VBT : BOOLEAN := IDENT_BOOL(TRUE);
43
     VBF : BOOLEAN := IDENT_BOOL(FALSE);
44
 
45
     FLOW_COUNT : INTEGER := 0;
46
 
47
BEGIN
48
     TEST ("C53007A", "CHECK THAT CONTROL FLOWS CORRECTLY IN SIMPLE " &
49
           "NESTED IF_STATEMENTS");
50
 
51
     IF VBF THEN  -- (FALSE)
52
          FAILED ("INCORRECT CONTROL FLOW 1");
53
     ELSIF CI9 < 20 THEN  -- (TRUE)
54
          FLOW_COUNT := FLOW_COUNT + 1;
55
          IF VI1 /= 0 AND TRUE THEN  -- (TRUE)
56
               FLOW_COUNT := FLOW_COUNT + 1;
57
          ELSE FAILED ("INCORRECT CONTROL FLOW 2");
58
          END IF;
59
     ELSE FAILED ("INCORRECT CONTROL FLOW 3");
60
     END IF;
61
 
62
     IF CBF OR ELSE VI9 = 9 THEN  -- (TRUE)
63
          IF VI1 + CI9 > 0 OR (CBF AND VBT) THEN  -- (TRUE)
64
               FLOW_COUNT := FLOW_COUNT + 1;
65
          END IF;
66
     ELSIF VBF OR VI1 > 10 THEN  -- (FALSE)
67
          FAILED ("INCORRECT CONTROL FLOW 4");
68
     END IF;
69
 
70
     IF NOT CBT AND THEN NOT VBT AND THEN CI9 < 0 THEN  -- (FALSE)
71
          IF FALSE OR NOT TRUE THEN  -- (FALSE)
72
               FAILED ("INCORRECT CONTROL FLOW 5");
73
          ELSIF VI1 >= 0 THEN  -- (TRUE)
74
               NULL;
75
          ELSE FAILED ("INCORRECT CONTROL FLOW 6");
76
          END IF;
77
          FAILED ("INCORRECT CONTROL FLOW 7");
78
     ELSIF (VI1 * CI9 + 3 < 0) OR (VBT AND NOT (CI1 < 0)) THEN -- (TRUE)
79
          FLOW_COUNT := FLOW_COUNT + 1;
80
          IF NOT CBT OR ELSE CI9 + 1 = 0 THEN  -- (FALSE)
81
               FAILED ("INCORRECT CONTROL FLOW 8");
82
          ELSE FLOW_COUNT := FLOW_COUNT + 1;
83
               IF VI1 * 2 > 0 THEN  -- (TRUE)
84
                    FLOW_COUNT := FLOW_COUNT + 1;
85
               ELSIF TRUE THEN  -- (TRUE)
86
                    FAILED ("INCORRECT CONTROL FLOW 9");
87
               ELSE NULL;
88
               END IF;
89
          END IF;
90
     ELSIF FALSE AND CBF THEN  -- (FALSE)
91
          FAILED ("INCORRECT CONTROL FLOW 10");
92
     ELSE IF VBT THEN  -- (TRUE)
93
               FAILED ("INCORRECT CONTROL FLOW 11");
94
          ELSIF VI1 = 0 THEN  -- (FALSE)
95
               FAILED ("INCORRECT CONTROL FLOW 12");
96
          ELSE FAILED ("INCORRECT CONTROL FLOW 13");
97
          END IF;
98
     END IF;
99
 
100
     IF 3 = 5 OR NOT VBT THEN  -- (FALSE)
101
          FAILED ("INCORRECT CONTROL FLOW 14");
102
          IF TRUE AND CBT THEN  -- (TRUE)
103
               FAILED ("INCORRECT CONTROL FLOW 15");
104
          ELSE FAILED ("INCORRECT CONTROL FLOW 16");
105
          END IF;
106
     ELSIF CBF THEN  -- (FALSE)
107
          IF VI9 >= 0 OR FALSE THEN  -- (TRUE)
108
               IF VBT THEN  -- (TRUE)
109
                    FAILED ("INCORRECT CONTROL FLOW 17");
110
               END IF;
111
               FAILED ("INCORRECT CONTROL FLOW 18");
112
          ELSIF VI1 + CI9 /= 0 THEN  -- (TRUE)
113
               FAILED ("INCORRECT CONTROL FLOW 19");
114
          END IF;
115
          FAILED ("INCORRECT CONTROL FLOW 20");
116
     ELSE IF VBT AND CI9 - 9 = 0 THEN  -- (TRUE)
117
               IF FALSE THEN  -- (FALSE)
118
                    FAILED ("INCORRECT CONTROL FLOW 21");
119
               ELSIF NOT VBF AND THEN CI1 > 0 THEN  -- (TRUE)
120
                    FLOW_COUNT := FLOW_COUNT + 1;
121
               ELSE FAILED ("INCORRECT CONTROL FLOW 22");
122
               END IF;
123
               FLOW_COUNT := FLOW_COUNT + 1;
124
          ELSIF NOT CBF OR VI1 /= 0 THEN  -- (TRUE)
125
               IF VBT THEN  -- (TRUE)
126
                    NULL;
127
               END IF;
128
               FAILED ("INCORRECT CONTROL FLOW 23");
129
          ELSE FAILED ("INCORRECT CONTROL FLOW 24");
130
          END IF;
131
          FLOW_COUNT := FLOW_COUNT + 1;
132
     END IF;
133
 
134
     IF FLOW_COUNT /= 9 THEN
135
          FAILED ("INCORRECT FLOW_COUNT VALUE");
136
     END IF;
137
 
138
     RESULT;
139
END C53007A;

powered by: WebSVN 2.1.0

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