aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-04-11 19:11:08 +0200
committerTristan Gingold <tgingold@free.fr>2018-04-11 19:11:08 +0200
commit60f3bb31069e3c7aeff03945a7cde7c4506bf37e (patch)
tree5b80beb451bc47c1239b5ae96938fba6d23211cb /testsuite
parent1e3f9a3a03620f561a4adaf27995c1b0e0d75ae7 (diff)
downloadghdl-60f3bb31069e3c7aeff03945a7cde7c4506bf37e.tar.gz
ghdl-60f3bb31069e3c7aeff03945a7cde7c4506bf37e.tar.bz2
ghdl-60f3bb31069e3c7aeff03945a7cde7c4506bf37e.zip
Add reproducer for #552
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue552/strings_test.vhdl27
-rwxr-xr-xtestsuite/gna/issue552/testsuite.sh10
2 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/gna/issue552/strings_test.vhdl b/testsuite/gna/issue552/strings_test.vhdl
new file mode 100644
index 000000000..ab3687917
--- /dev/null
+++ b/testsuite/gna/issue552/strings_test.vhdl
@@ -0,0 +1,27 @@
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.NUMERIC_STD.ALL;
+
+entity strings_test is
+end strings_test;
+
+architecture rtl of strings_test is
+ type T_TYPE is (TYPE_1, TYPE_2, TYPE_3);
+
+ function str_low(str : string) return integer is
+ begin
+ assert str'low = 1 severity failure;
+ return str'low;
+ end function;
+
+ constant string1 : string := "TYPE_1";
+ constant string2 : T_TYPE := TYPE_1;
+
+begin
+
+assert false report "str_low of type'image : i =" & integer'image(str_low(T_TYPE'image(string2))) severity note;
+assert false report "tic low of type'image : i =" & integer'image(T_TYPE'image(string2)'low) severity note;
+assert false report "tic low of string : i =" & integer'image(string1'low) severity note;
+assert false report "str_low of string : i =" & integer'image(str_low(string1)) severity note;
+
+end rtl;
diff --git a/testsuite/gna/issue552/testsuite.sh b/testsuite/gna/issue552/testsuite.sh
new file mode 100755
index 000000000..8d0b4f3c4
--- /dev/null
+++ b/testsuite/gna/issue552/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze strings_test.vhdl
+elab_simulate strings_test
+
+clean
+
+echo "Test successful"