diff options
Diffstat (limited to 'testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/integer-types')
2 files changed, 70 insertions, 0 deletions
diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/integer-types/resolved-integer-type.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/integer-types/resolved-integer-type.vhdl new file mode 100644 index 000000000..2a55fe20a --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/integer-types/resolved-integer-type.vhdl @@ -0,0 +1,44 @@ +entity test is +end test; + +architecture only of test is + type integer_array is array ( natural range <> ) of integer; + + function return_biggest ( inputs : integer_array ) + return integer is + variable retval : integer := integer'left; + begin + for i in inputs'range loop + if inputs(i) > retval then + retval := inputs(i); + end if; + end loop; -- i + return retval; + end return_biggest; + + subtype biggest_wins is return_biggest integer; + + signal common : biggest_wins; + +begin -- only + + p1 : process + begin + common <= 1 after 1 ns; + wait; + end process; + + p2 : process + begin + common <= 1 after 1 ns; + wait; + end process; + + test: process + begin + wait for 2 ns; + assert common = 1 report "TEST FAILED" severity failure; + wait; + end process; + +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/integer-types/subprogram-dynamic-type.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/integer-types/subprogram-dynamic-type.vhdl new file mode 100644 index 000000000..92f5347ac --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/integer-types/subprogram-dynamic-type.vhdl @@ -0,0 +1,26 @@ +entity test is +end test; + +architecture only of test is + procedure proc ( constant l : in integer; + constant r : in integer ) is + type dyn is range l to r; + constant x : dyn; + begin + + if r = 3 then + assert x = 1 report "TEST FAILED" severity FAILURE; + elsif r = 42 then + assert x = 0 report "TEST FAILED" severity FAILURE; + end if; + + end proc; +begin -- only + doit: process + begin -- process doit + proc( 1, 3 ); + proc( 0, 42 ); + report "TEST PASSED"; + wait; + end process doit; +end only; |