aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug06
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-01-15 06:36:00 +0100
committerTristan Gingold <tgingold@free.fr>2015-01-15 06:36:00 +0100
commitb2581a045d696a43bef147cd782721182db14f2f (patch)
tree48e537e819dc27a388c474599b5674a81d96c9fe /testsuite/gna/bug06
parentfa540976b1be8ba88c2a659c8b5c7fdd025725df (diff)
downloadghdl-b2581a045d696a43bef147cd782721182db14f2f.tar.gz
ghdl-b2581a045d696a43bef147cd782721182db14f2f.tar.bz2
ghdl-b2581a045d696a43bef147cd782721182db14f2f.zip
Testcase for locally static array comparaison.
Diffstat (limited to 'testsuite/gna/bug06')
-rw-r--r--testsuite/gna/bug06/repro.vhdl29
-rwxr-xr-xtestsuite/gna/bug06/testsuite.sh10
2 files changed, 39 insertions, 0 deletions
diff --git a/testsuite/gna/bug06/repro.vhdl b/testsuite/gna/bug06/repro.vhdl
new file mode 100644
index 000000000..02b275dbf
--- /dev/null
+++ b/testsuite/gna/bug06/repro.vhdl
@@ -0,0 +1,29 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity foo is
+end entity;
+architecture fum of foo is
+ constant A: std_logic_vector (7 downto 0) := X"04";
+
+ function slv_image(inp: std_logic_vector) return string is
+ variable image_str: string (1 to inp'length);
+ alias input_str: std_logic_vector (1 to inp'length) is inp;
+ begin
+ for i in input_str'range loop
+ image_str(i) := character'VALUE(std_ulogic'IMAGE(input_str(i)));
+ end loop;
+ return image_str;
+ end;
+
+begin
+SOME_LABEL:
+ process
+ begin
+ wait for 1 ns;
+ if A <= "00001011" then -- if A <= std_logic_vector'("00001011") then
+ report "A = " & slv_image(A) ;
+ end if;
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/bug06/testsuite.sh b/testsuite/gna/bug06/testsuite.sh
new file mode 100755
index 000000000..f98b814b1
--- /dev/null
+++ b/testsuite/gna/bug06/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze repro.vhdl
+elab_simulate foo
+
+clean
+
+echo "Test successful"