aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue2147
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/issue2147')
-rw-r--r--testsuite/gna/issue2147/e.vhdl15
-rw-r--r--testsuite/gna/issue2147/e2.vhdl14
-rwxr-xr-xtestsuite/gna/issue2147/testsuite.sh12
3 files changed, 41 insertions, 0 deletions
diff --git a/testsuite/gna/issue2147/e.vhdl b/testsuite/gna/issue2147/e.vhdl
new file mode 100644
index 000000000..830360370
--- /dev/null
+++ b/testsuite/gna/issue2147/e.vhdl
@@ -0,0 +1,15 @@
+use std.textio.all;
+
+entity e is end;
+
+architecture a of e is
+ function f return line is
+ begin
+ return new string'("");
+ end;
+
+ -- This line causes the crash
+ constant c : bit := f'range;
+begin
+end;
+
diff --git a/testsuite/gna/issue2147/e2.vhdl b/testsuite/gna/issue2147/e2.vhdl
new file mode 100644
index 000000000..d83dadc23
--- /dev/null
+++ b/testsuite/gna/issue2147/e2.vhdl
@@ -0,0 +1,14 @@
+entity e2 is end;
+
+architecture a of e2 is
+ type bv_acc is access bit_vector;
+ function f return bv_acc is
+ begin
+ return new bit_vector'("01");
+ end;
+
+ -- This line causes the crash
+ constant c : bit_vector (f'range) := (others => '0');
+begin
+end;
+
diff --git a/testsuite/gna/issue2147/testsuite.sh b/testsuite/gna/issue2147/testsuite.sh
new file mode 100755
index 000000000..0a66d0a9d
--- /dev/null
+++ b/testsuite/gna/issue2147/testsuite.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze_failure e.vhdl
+
+analyze e2.vhdl
+elab_simulate e2
+
+clean
+
+echo "Test successful"