diff options
author | Tristan Gingold <tgingold@free.fr> | 2013-12-20 04:48:54 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2013-12-20 04:48:54 +0100 |
commit | 6c3f709174e8e4d5411f851cedb7d84c38d3b04a (patch) | |
tree | bd12c79c71a2ee65899a9ade9919ec2045addef8 /testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes | |
parent | bd4aff0f670351c0652cf24e9b04361dc0e3a01c (diff) | |
download | ghdl-6c3f709174e8e4d5411f851cedb7d84c38d3b04a.tar.gz ghdl-6c3f709174e8e4d5411f851cedb7d84c38d3b04a.tar.bz2 ghdl-6c3f709174e8e4d5411f851cedb7d84c38d3b04a.zip |
Import vests testsuite
Diffstat (limited to 'testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes')
24 files changed, 359 insertions, 0 deletions
diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-ascending-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-ascending-attribute.vhdl new file mode 100644 index 000000000..d1df1c860 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-ascending-attribute.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type my_type is array(0 to 3) of integer; +begin -- only + p: process + begin -- process p + assert (my_type'ascending) report "TEST FAILED ascending" severity failure; + report "TEST PASSED ascending"; + wait; + end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-high-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-high-attribute.vhdl new file mode 100644 index 000000000..18f508be5 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-high-attribute.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type my_type is array(0 to 3) of integer; +begin -- only + p: process + begin -- process p + assert my_type'high = 3 report "TEST FAILED high = 3" severity failure; + report "TEST PASSED high = 3"; + wait; + end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-left-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-left-attribute.vhdl new file mode 100644 index 000000000..9c7f3b0ea --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-left-attribute.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type my_type is array(0 to 3) of integer; +begin -- only + p: process + begin -- process p + assert my_type'left = 0 report "TEST FAILED left = 0" severity failure; + report "TEST PASSED left = 0"; + wait; + end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-length-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-length-attribute.vhdl new file mode 100644 index 000000000..add2c6c88 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-length-attribute.vhdl @@ -0,0 +1,15 @@ +entity foo is +end foo; + +use std.textio.all; + +architecture only of foo is +begin -- only + process + variable x : string(1 to 4) := "1234"; + begin -- process + assert x'length = 4 report "TEST FAILED - x'length does not equal 4" severity failure; + assert x'length /= 4 report "TEST PASSED" severity note; + wait; + end process; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-low-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-low-attribute.vhdl new file mode 100644 index 000000000..bbec01327 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-low-attribute.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type my_type is array(0 to 3) of integer; +begin -- only + p: process + begin -- process p + assert my_type'low = 0 report "TEST FAILED low = 0" severity failure; + report "TEST PASSED low = 0"; + wait; + end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-right-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-right-attribute.vhdl new file mode 100644 index 000000000..d73f0829a --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/array/simple-right-attribute.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type my_type is array(0 to 3) of integer; +begin -- only + p: process + begin -- process p + assert my_type'right = 3 report "TEST FAILED right = 3" severity failure; + report "TEST PASSED right = 3"; + wait; + end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-event-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-event-attribute.vhdl new file mode 100644 index 000000000..e3c5d30cb --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-event-attribute.vhdl @@ -0,0 +1,22 @@ +entity test is +end test; + +architecture only of test is + signal s : bit; +begin + s <= '1' after 10 ns, '0' after 20 ns, '1' after 30 ns, '0' after 40 ns; + p: process + begin + wait for 1 ns; + assert not(s'event) report "TEST FAILED - 'event active" severity failure; + wait for 25 ns; + -- s <= '1'; +-- wait for 0 ns; + assert s = '0' report "TEST FAILED - s has not changed to 0 yet!" severity failure; + wait for 10 ns; + assert s = '1' report "TEST FAILED - s has not changed to 1 yet!" severity failure; + assert (s'event) report "TEST FAILED - 'event not tripped" severity failure; + report "TEST PASSED"; + wait; + end process; +end architecture only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-last-value.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-last-value.vhdl new file mode 100644 index 000000000..a2e0133b4 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-last-value.vhdl @@ -0,0 +1,15 @@ +entity test is +end test; + +architecture only of test is + signal s : bit := '0'; +begin + p : process + begin + s <= '1'; + wait for 0 fs; + assert s'last_value = '0' report "TEST FAILED" severity failure; + report "TEST PASSED"; + wait; + end process; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-last_event-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-last_event-attribute.vhdl new file mode 100644 index 000000000..dfe1f2224 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-last_event-attribute.vhdl @@ -0,0 +1,21 @@ +entity test is +end test; + +architecture only of test is + signal s : bit; +begin + s <= '1' after 5 ns, '0' after 20 ns, '1' after 30 ns, '0' after 40 ns; + p: process + variable v: time; + begin + wait for 15 ns; + v:=s'last_event; + assert v = 10 ns report "TEST FAILED - s previous value incorrect!" severity failure; + report "TEST PASSED elapsed time is 10 ns" ; + wait for 14 ns; + v:=s'last_event; + assert v = 9 ns report "TEST FAILED - s previous value incorrect!" severity failure; + report "TEST PASSED elapsed time is 9 ns" ; + wait; + end process; +end architecture only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-last_value-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-last_value-attribute.vhdl new file mode 100644 index 000000000..eafaf406b --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/signal/simple-last_value-attribute.vhdl @@ -0,0 +1,18 @@ +entity test is +end test; + +architecture only of test is + signal s : bit; +begin + s <= '1' after 10 ns, '0' after 20 ns, '1' after 30 ns, '0' after 40 ns; + p: process + variable v: bit; + begin + wait for 1 ns; + wait for 25 ns; + v:=s'last_value; + assert v = '1' report "TEST FAILED - s previous value incorrect!" severity failure; + report "TEST PASSED v = 1" ; + wait; + end process; +end architecture only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/base/simple-integer-test.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/base/simple-integer-test.vhdl new file mode 100644 index 000000000..a47da0b32 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/base/simple-integer-test.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + subtype small is integer range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'base'left = integer'left report "TEST FAILED" severity FAILURE; + report "TEST PASSED" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/left/simple-integer-test.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/left/simple-integer-test.vhdl new file mode 100644 index 000000000..34b52d6c6 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/left/simple-integer-test.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'left = 1 report "TEST FAILED" severity FAILURE; + report "TEST PASSED" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/range/simple-range-attribute.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/range/simple-range-attribute.vhdl new file mode 100644 index 000000000..b3692a5da --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/range/simple-range-attribute.vhdl @@ -0,0 +1,14 @@ +entity test is +end test; + +architecture only of test is + type my_type is array(0 to 3) of integer; +begin -- only + p: process + begin -- process p + assert my_type'range'left = 0 report "TEST FAILED" severity failure; + assert my_type'range'right = 3 report "TEST FAILED" severity failure; + report "TEST PASSED"; + wait; + end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/right/simple-integer-test.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/right/simple-integer-test.vhdl new file mode 100644 index 000000000..4ebe8a171 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/right/simple-integer-test.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'right = 3 report "TEST FAILED" severity FAILURE; + report "TEST PASSED" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-ascending.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-ascending.vhdl new file mode 100644 index 000000000..d5dc98297 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-ascending.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert (small'ascending) report "TEST FAILED ascending" severity FAILURE; + report "TEST PASSED ascending" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-high.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-high.vhdl new file mode 100644 index 000000000..86f478a99 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-high.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'high = 3 report "TEST FAILED T high" severity FAILURE; + report "TEST PASSED T high" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-image.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-image.vhdl new file mode 100644 index 000000000..0b62a3e11 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-image.vhdl @@ -0,0 +1,17 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'image(1) = "1" report "TEST FAILED image 1" severity FAILURE; + report "TEST PASSED image 1" severity NOTE; + assert small'image(2) = "2" report "TEST FAILED image 2" severity FAILURE; + report "TEST PASSED image 2" severity NOTE; + assert small'image(3) = "3" report "TEST FAILED image 3" severity FAILURE; + report "TEST PASSED image 3" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-leftof.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-leftof.vhdl new file mode 100644 index 000000000..b82884a13 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-leftof.vhdl @@ -0,0 +1,15 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'leftof(2) = 1 report "TEST FAILED. leftof 2 = 1" severity FAILURE; + report "TEST PASSED leftof 2 = 1" severity NOTE; + assert small'leftof(3) = 2 report "TEST FAILED. leftof 3 = 2" severity FAILURE; + report "TEST PASSED leftof 3 = 2" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-low.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-low.vhdl new file mode 100644 index 000000000..849996334 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-low.vhdl @@ -0,0 +1,13 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'low = 1 report "TEST FAILED T low" severity FAILURE; + report "TEST PASSED T low" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-pred.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-pred.vhdl new file mode 100644 index 000000000..03aebd7c3 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-pred.vhdl @@ -0,0 +1,15 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'pred(2) = 1 report "TEST FAILED. pred 2 = 1" severity FAILURE; + report "TEST PASSED pred 2 = 1" severity NOTE; + assert small'pred(3) = 2 report "TEST FAILED. pred 3 = 2" severity FAILURE; + report "TEST PASSED pred 3 = 2" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-rightof.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-rightof.vhdl new file mode 100644 index 000000000..de11c66c1 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-rightof.vhdl @@ -0,0 +1,15 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'rightof(1) = 2 report "TEST FAILED. rightof 1 = 2" severity FAILURE; + report "TEST PASSED rightof 1 = 2" severity NOTE; + assert small'rightof(2) = 3 report "TEST FAILED. rightof 2 = 3" severity FAILURE; + report "TEST PASSED rightof 2 = 3" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-succ.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-succ.vhdl new file mode 100644 index 000000000..3f27b004d --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-succ.vhdl @@ -0,0 +1,15 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'succ(1) = 2 report "TEST FAILED. succ 1 = 2" severity FAILURE; + report "TEST PASSED succ 1 = 2" severity NOTE; + assert small'succ(2) = 3 report "TEST FAILED. succ 2 = 3" severity FAILURE; + report "TEST PASSED succ 2 = 3" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-val.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-val.vhdl new file mode 100644 index 000000000..db5064bbc --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-val.vhdl @@ -0,0 +1,17 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'val(1) = 1 report "TEST FAILED val pos 1" severity FAILURE; + report "TEST PASSED val pos 1" severity NOTE; + assert small'val(2) = 2 report "TEST FAILED val pos 2" severity FAILURE; + report "TEST PASSED val pos 2" severity NOTE; + assert small'val(3) = 3 report "TEST FAILED val pos 3" severity FAILURE; + report "TEST PASSED val pos 3" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-value.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-value.vhdl new file mode 100644 index 000000000..97b6cd247 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-value.vhdl @@ -0,0 +1,17 @@ +entity test is +end test; + +architecture only of test is + type small is range 1 to 3; +begin -- only +p: process +begin -- process p + assert small'value("1") = 1 report "TEST FAILED value 1" severity FAILURE; + report "TEST PASSED value 1" severity NOTE; + assert small'value("2") = 2 report "TEST FAILED value 2" severity FAILURE; + report "TEST PASSED value 2" severity NOTE; + assert small'value("3") = 3 report "TEST FAILED value 3" severity FAILURE; + report "TEST PASSED value 3" severity NOTE; + wait; +end process p; +end only; |