aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-20 17:24:36 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-20 17:24:36 +0100
commitcfc292a4d7319d6599b1d9f74b879301d71af63d (patch)
treead5fbc65c1cf5815e2169f319ce6ee012736e2bb /testsuite
parent1d566ee1a598f2c80b0928c9b29a799590d8822b (diff)
downloadghdl-cfc292a4d7319d6599b1d9f74b879301d71af63d.tar.gz
ghdl-cfc292a4d7319d6599b1d9f74b879301d71af63d.tar.bz2
ghdl-cfc292a4d7319d6599b1d9f74b879301d71af63d.zip
Add reproducer for #610.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue610/repro1.vhdl18
-rw-r--r--testsuite/gna/issue610/repro2.vhdl15
-rw-r--r--testsuite/gna/issue610/repro3.vhdl17
-rw-r--r--testsuite/gna/issue610/repro4.vhdl19
-rwxr-xr-xtestsuite/gna/issue610/testsuite.sh23
5 files changed, 92 insertions, 0 deletions
diff --git a/testsuite/gna/issue610/repro1.vhdl b/testsuite/gna/issue610/repro1.vhdl
new file mode 100644
index 000000000..dfbc91f7d
--- /dev/null
+++ b/testsuite/gna/issue610/repro1.vhdl
@@ -0,0 +1,18 @@
+entity repro1 is
+ port (d : bit_vector := x"01");
+end repro1;
+
+
+architecture behav of repro1
+is
+ type t_bv_array is array (natural range <>) of bit_vector;
+begin
+ process
+ variable v : t_bv_array (0 to 0)(d'length - 1 downto 0);
+ begin
+ v(0) := d;
+ assert v(0)(0) = '1' severity failure;
+ assert v(0)(1) = '0' severity failure;
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue610/repro2.vhdl b/testsuite/gna/issue610/repro2.vhdl
new file mode 100644
index 000000000..1473eeb76
--- /dev/null
+++ b/testsuite/gna/issue610/repro2.vhdl
@@ -0,0 +1,15 @@
+entity repro2 is
+ generic (l : natural := 10);
+end repro2;
+
+architecture behav of repro2 is
+begin
+ process
+ variable v : string (0 to l);
+ alias a : string is v;
+ begin
+ v := (others => ' ');
+ a := (others => 'x');
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue610/repro3.vhdl b/testsuite/gna/issue610/repro3.vhdl
new file mode 100644
index 000000000..dda5b8963
--- /dev/null
+++ b/testsuite/gna/issue610/repro3.vhdl
@@ -0,0 +1,17 @@
+entity repro3 is
+end repro3;
+
+architecture behav of repro3 is
+ procedure set (v : out string) is
+ begin
+ v := (others => ' ');
+ end set;
+begin
+ process
+ variable s : string (1 to 4);
+ begin
+ set (s);
+ assert s = " " severity failure;
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue610/repro4.vhdl b/testsuite/gna/issue610/repro4.vhdl
new file mode 100644
index 000000000..6ede420d2
--- /dev/null
+++ b/testsuite/gna/issue610/repro4.vhdl
@@ -0,0 +1,19 @@
+entity repro4 is
+end repro4;
+
+architecture behav of repro4 is
+ procedure set (signal v : out string) is
+ begin
+ v <= (others => ' ');
+ end set;
+ signal s : string (1 to 3);
+begin
+ set (s);
+
+ process
+ begin
+ wait for 0 ns;
+ assert s = " " severity failure;
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue610/testsuite.sh b/testsuite/gna/issue610/testsuite.sh
new file mode 100755
index 000000000..9c9cc5c5c
--- /dev/null
+++ b/testsuite/gna/issue610/testsuite.sh
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze repro1.vhdl
+elab_simulate repro1
+
+clean
+
+export GHDL_STD_FLAGS=-frelaxed-rules
+analyze repro2.vhdl
+elab_simulate repro2
+
+analyze repro3.vhdl
+#elab_simulate repro3
+
+analyze repro4.vhdl
+#elab_simulate repro4
+
+clean
+
+echo "Test successful"