aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops')
-rw-r--r--testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_package_procedure_for_loop.vhdl30
-rw-r--r--testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_procedure_for_loop.vhdl22
-rw-r--r--testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop-constrained.vhdl17
-rw-r--r--testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop.vhdl17
-rw-r--r--testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/integer-for-loop.vhdl16
5 files changed, 102 insertions, 0 deletions
diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_package_procedure_for_loop.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_package_procedure_for_loop.vhdl
new file mode 100644
index 000000000..48d810f63
--- /dev/null
+++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_package_procedure_for_loop.vhdl
@@ -0,0 +1,30 @@
+package pkg is
+ procedure iterate (
+ input : in bit_vector);
+end pkg;
+
+package body pkg is
+ procedure iterate (
+ input : in bit_vector) is
+ variable j : integer := input'range'left;
+ begin -- iterate
+ for i in input'range loop
+ assert i = j report "TEST FAILED" severity failure;
+ j := j + 1;
+ end loop; -- i in 1 to 10
+ assert j = input'range'right + 1 report "TEST FAILED" severity failure;
+ end iterate;
+end pkg;
+
+entity test is
+end test;
+
+architecture only of test is
+begin -- only
+ doit: process
+ begin -- process doit
+ work.pkg.iterate("0000");
+ report "TEST PASSED";
+ wait;
+ end process doit;
+end only;
diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_procedure_for_loop.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_procedure_for_loop.vhdl
new file mode 100644
index 000000000..0ce8edae3
--- /dev/null
+++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_procedure_for_loop.vhdl
@@ -0,0 +1,22 @@
+entity test is
+end test;
+
+architecture only of test is
+ procedure iterate (
+ input : in bit_vector) is
+ variable j : integer := input'range'left;
+ begin -- iterate
+ for i in input'range loop
+ assert i = j report "TEST FAILED" severity failure;
+ j := j + 1;
+ end loop; -- i in 1 to 10
+ assert j = input'range'right + 1 report "TEST FAILED" severity failure;
+ end iterate;
+begin -- only
+ doit: process
+ begin -- process doit
+ iterate("0000");
+ report "TEST PASSED";
+ wait;
+ end process doit;
+end only;
diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop-constrained.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop-constrained.vhdl
new file mode 100644
index 000000000..647642e3b
--- /dev/null
+++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop-constrained.vhdl
@@ -0,0 +1,17 @@
+entity test is
+end test;
+
+architecture only of test is
+begin -- only
+p: process
+ type color is ( red, blue, green );
+ variable x : color;
+begin -- process p
+ for i in red to blue loop
+ x := i;
+ end loop; -- i
+ assert x = blue report "TEST FAILED x was " & color'image(x) severity ERROR;
+ report "TEST PASSED" severity NOTE;
+ wait;
+end process p;
+end only;
diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop.vhdl
new file mode 100644
index 000000000..2330e1823
--- /dev/null
+++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop.vhdl
@@ -0,0 +1,17 @@
+entity test is
+end test;
+
+architecture only of test is
+begin -- only
+p: process
+ type color is ( red, blue, green );
+ variable x : color;
+begin -- process p
+ for i in red to green loop
+ x := i;
+ end loop; -- i
+ assert x = green report "TEST FAILED x was " & color'image(x) severity ERROR;
+ report "TEST PASSED" severity NOTE;
+ wait;
+end process p;
+end only;
diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/integer-for-loop.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/integer-for-loop.vhdl
new file mode 100644
index 000000000..1a7db2f6a
--- /dev/null
+++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/integer-for-loop.vhdl
@@ -0,0 +1,16 @@
+entity test is
+end test;
+
+architecture only of test is
+begin -- only
+p: process
+ variable x : integer;
+begin -- process p
+ for i in 1 to 10 loop
+ x := i;
+ end loop; -- i
+ assert x = 10 report "TEST FAILED x was " & integer'image(x) severity ERROR;
+ report "TEST PASSED" severity NOTE;
+ wait;
+end process p;
+end only;