aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/gna/issue204/repro.vhdl22
-rwxr-xr-xtestsuite/gna/issue204/testsuite.sh10
2 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/gna/issue204/repro.vhdl b/testsuite/gna/issue204/repro.vhdl
new file mode 100644
index 000000000..09abdbbcb
--- /dev/null
+++ b/testsuite/gna/issue204/repro.vhdl
@@ -0,0 +1,22 @@
+package SortListGenericPkg is
+ generic (
+ type ElementType;
+ type ArrayofElementType;
+ function array_length(A : ArrayofElementType) return natural;
+ function element_get(A : ArrayofElementType; index : natural) return ElementType
+ );
+
+ function inside (constant E : ElementType; constant A : in ArrayofElementType) return boolean ;
+end package;
+
+package body SortListGenericPkg is
+ function inside (constant E : ElementType; constant A : in ArrayofElementType) return boolean is
+ begin
+ for i in 0 to array_length(A) - 1 loop --A'range loop
+ if E = element_get(A, i) then
+ return TRUE ;
+ end if ;
+ end loop ;
+ return FALSE ;
+ end function inside ;
+end package body;
diff --git a/testsuite/gna/issue204/testsuite.sh b/testsuite/gna/issue204/testsuite.sh
new file mode 100755
index 000000000..7b37332aa
--- /dev/null
+++ b/testsuite/gna/issue204/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze repro.vhdl
+
+clean
+
+echo "Test successful"