test.cpp revision 12855:588919e0e4aa
1/*****************************************************************************
2
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements.  See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License.  You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied.  See the License for the specific language governing
16  permissions and limitations under the License.
17
18 *****************************************************************************/
19
20/*****************************************************************************
21
22  test.cpp --
23
24  Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
25
26 *****************************************************************************/
27
28/*****************************************************************************
29
30  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
31  changes you are making here.
32
33      Name, Affiliation, Date:
34  Description of Modification:
35
36 *****************************************************************************/
37
38//
39//	Verifies loop unrolling
40//
41//      Test Plan: 5.2
42//
43//	Author: PRP
44//	Date Created: 19 Feb 99
45//
46
47
48#include "test.h"
49
50void test::entry()
51{
52  int i,j;
53  int a[10],b[10];
54
55
56  do { wait(); } while  (cont1 == 0);
57  wait ();
58
59  i = 0;
60  while (i < 4) {
61        a[i] = 0;
62        i = i + 1;
63  }
64
65  i = 0;
66  while (i <= 4) {
67        b[i] = 10;
68        i = i + 1;
69  }
70
71  i = 9;
72  while (i > 4) {
73        a[i] = 20;
74        i = i - 1;
75  }
76
77  i = 9;
78  while (i >= 4) {
79        b[i] = 30;
80        i = i - 1;
81  }
82
83  i = -4;
84  while (i < 0) {
85        a[i+4] = 40;
86        i = i + 1;
87  }
88
89
90  i = -4;
91  while (i < 0) {
92        a[i+4] = 50;
93        i = i + 2;
94  }
95
96  i = -4;
97  while (i <= 0) {
98        a[i+4] = 60;
99        i = i + 2;
100  }
101
102  i = -4;
103  while (i <= 0) {
104        a[i+4] = 70;
105        i = i + 3;
106  }
107  i = -4;
108  while (i <= 0) {
109        a[i+4] = 80;
110        i = i + 4;
111  }
112
113  i = -6;
114  while (i <= 0) {
115        a[i+6] = 90;
116        i = i + 5;
117  }
118
119  i = 8;
120  if (i) {
121        j = 9;
122  }
123
124  while (i <= 10) {
125        a[i] = 80;
126        i = i + 5;
127  }
128
129  for (i = 0; i < 2; i++)
130        a[i] = 8;
131
132  i = 0;
133  for (; i < 3; i++)
134        a[i] = 10;
135
136  i = 0;
137  wait();
138  for (; i < 3; ++i) {
139        a[i] = 11;
140        //i = i + 1;
141  wait();
142  }
143
144   i = 0;
145  for (; i < 3; i++)
146        a[i] = 12;
147
148  wait();
149
150}
151
152