diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-01-13 04:33:28 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-01-13 18:57:25 +0100 |
commit | 5d7d8b1466c1e6fe22370e09e9db9d61cd707da0 (patch) | |
tree | 57dcd6ce2bf2d56415ec8690aaf7b26bbc0a13eb /testsuite/gna | |
parent | 1dfa4c3a364523c19cf9f5ff1b4bb00dda29b41e (diff) | |
download | ghdl-5d7d8b1466c1e6fe22370e09e9db9d61cd707da0.tar.gz ghdl-5d7d8b1466c1e6fe22370e09e9db9d61cd707da0.tar.bz2 ghdl-5d7d8b1466c1e6fe22370e09e9db9d61cd707da0.zip |
Add testcase for #253
Diffstat (limited to 'testsuite/gna')
-rw-r--r-- | testsuite/gna/issue253/e.vhdl | 13 | ||||
-rw-r--r-- | testsuite/gna/issue253/e2.vhdl | 17 | ||||
-rwxr-xr-x | testsuite/gna/issue253/testsuite.sh | 14 |
3 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/gna/issue253/e.vhdl b/testsuite/gna/issue253/e.vhdl new file mode 100644 index 000000000..a261312ed --- /dev/null +++ b/testsuite/gna/issue253/e.vhdl @@ -0,0 +1,13 @@ +entity e is +end entity; + +architecture a of e is + signal a : bit; + constant b : bit := '0'; +begin + assert FALSE report bit'image(a'subtype'left) severity NOTE; + assert FALSE report bit'image(b'subtype'left) severity NOTE; + + assert FALSE report a'subtype'image(a) severity NOTE; + assert FALSE report b'subtype'image(b) severity NOTE; +end architecture; diff --git a/testsuite/gna/issue253/e2.vhdl b/testsuite/gna/issue253/e2.vhdl new file mode 100644 index 000000000..c93cb3703 --- /dev/null +++ b/testsuite/gna/issue253/e2.vhdl @@ -0,0 +1,17 @@ +entity e2 is +end entity; + +architecture a of e2 is + function get_left return natural is + begin + return 12; + end get_left; + + constant l : natural := get_left; + subtype t is integer range 0 to l; + signal a : t; +begin + assert FALSE report natural'image(a'subtype'left) severity NOTE; + + assert FALSE report a'subtype'image(a) severity NOTE; +end architecture; diff --git a/testsuite/gna/issue253/testsuite.sh b/testsuite/gna/issue253/testsuite.sh new file mode 100755 index 000000000..7bcc5e280 --- /dev/null +++ b/testsuite/gna/issue253/testsuite.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze e.vhdl +elab_simulate e + +analyze e2.vhdl +elab_simulate e2 + +clean + +echo "Test successful" |