From 6c3f709174e8e4d5411f851cedb7d84c38d3b04a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 20 Dec 2013 04:48:54 +0100 Subject: Import vests testsuite --- .../dynamic_package_procedure_for_loop.vhdl | 30 ++++++++++++++++++++++ .../for-loops/dynamic_procedure_for_loop.vhdl | 22 ++++++++++++++++ .../enumeration-for-loop-constrained.vhdl | 17 ++++++++++++ .../statements/for-loops/enumeration-for-loop.vhdl | 17 ++++++++++++ .../statements/for-loops/integer-for-loop.vhdl | 16 ++++++++++++ 5 files changed, 102 insertions(+) create mode 100644 testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_package_procedure_for_loop.vhdl create mode 100644 testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/dynamic_procedure_for_loop.vhdl create mode 100644 testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop-constrained.vhdl create mode 100644 testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/enumeration-for-loop.vhdl create mode 100644 testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops/integer-for-loop.vhdl (limited to 'testsuite/vests/vhdl-93/clifton-labs/compliant/functional/statements/for-loops') 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 0000000..48d810f --- /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 0000000..0ce8eda --- /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 0000000..647642e --- /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 0000000..2330e18 --- /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 0000000..1a7db2f --- /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; -- cgit