aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-09-07 21:37:50 +0200
committerTristan Gingold <tgingold@free.fr>2021-09-07 21:37:50 +0200
commit5a09c3b571749808a8aee26f71aaa963f78cf094 (patch)
treec9d965674a161989963208e142b80c251da95682 /testsuite
parentdd340008ba64eaf2a48e4bbda8011f757df9539c (diff)
downloadghdl-5a09c3b571749808a8aee26f71aaa963f78cf094.tar.gz
ghdl-5a09c3b571749808a8aee26f71aaa963f78cf094.tar.bz2
ghdl-5a09c3b571749808a8aee26f71aaa963f78cf094.zip
testsuite/gna: add a test for #451
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue451/e.vhdl15
-rwxr-xr-xtestsuite/gna/issue451/testsuite.sh11
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/gna/issue451/e.vhdl b/testsuite/gna/issue451/e.vhdl
new file mode 100644
index 000000000..ad69ed0c9
--- /dev/null
+++ b/testsuite/gna/issue451/e.vhdl
@@ -0,0 +1,15 @@
+entity e is end entity;
+architecture h of e is
+ type a is array(natural range<>, natural range<>) of integer_vector;
+ function f(x, y:integer := 0) return a is begin return (0 to 3=>(0 to 1=>(0 to 6=>y))); end function;
+ -- If the association list was mandatory f()(2,0)(5) would be far less confusing.
+ constant c :integer := f(2,0)(5);
+
+ type b is array(natural range<>) of integer_vector;
+ function g(x:integer := 0) return b is begin return (0 to 3=>(0 to 6=>45)); end function;
+ -- If the association list was mandatory g()(2)(5) would be far less confusing.
+ constant d :integer := g(2)(5);
+begin
+ assert false report integer'image(c) severity note;
+ assert false report integer'image(d) severity note;
+end architecture;
diff --git a/testsuite/gna/issue451/testsuite.sh b/testsuite/gna/issue451/testsuite.sh
new file mode 100755
index 000000000..1a4b10413
--- /dev/null
+++ b/testsuite/gna/issue451/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze e.vhdl
+elab_simulate e
+
+clean
+
+echo "Test successful"