From 60f3bb31069e3c7aeff03945a7cde7c4506bf37e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 11 Apr 2018 19:11:08 +0200 Subject: Add reproducer for #552 --- testsuite/gna/issue552/strings_test.vhdl | 27 +++++++++++++++++++++++++++ testsuite/gna/issue552/testsuite.sh | 10 ++++++++++ 2 files changed, 37 insertions(+) create mode 100644 testsuite/gna/issue552/strings_test.vhdl create mode 100755 testsuite/gna/issue552/testsuite.sh (limited to 'testsuite') 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" -- cgit v1.2.3