diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-12-08 20:34:42 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-12-08 20:34:42 +0100 |
commit | e559e5b01d9abdae3db0f723a853c4a64725e651 (patch) | |
tree | c12ec38ad1b5d37ee5e0dfb1ce3d81a860840f14 /testsuite/gna | |
parent | 9fb8b565e201edf9d8727159eeef3c40553219e3 (diff) | |
download | ghdl-e559e5b01d9abdae3db0f723a853c4a64725e651.tar.gz ghdl-e559e5b01d9abdae3db0f723a853c4a64725e651.tar.bz2 ghdl-e559e5b01d9abdae3db0f723a853c4a64725e651.zip |
Add reproducer for #204
Diffstat (limited to 'testsuite/gna')
-rw-r--r-- | testsuite/gna/issue204/repro.vhdl | 22 | ||||
-rwxr-xr-x | testsuite/gna/issue204/testsuite.sh | 10 |
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" |