diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-07-02 18:33:17 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-07-02 18:33:17 +0200 |
commit | acb6ffa4ea1eae70e3d9877cc485bb3fb82e3ea5 (patch) | |
tree | 94b79c0ac63ec37a8be497a8f1d353e4177af05b /testsuite | |
parent | b8c3a3c6d2250ebdf3216d9559caad54eb01d279 (diff) | |
download | ghdl-acb6ffa4ea1eae70e3d9877cc485bb3fb82e3ea5.tar.gz ghdl-acb6ffa4ea1eae70e3d9877cc485bb3fb82e3ea5.tar.bz2 ghdl-acb6ffa4ea1eae70e3d9877cc485bb3fb82e3ea5.zip |
testsuite/gna: add a test for #1387
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gna/issue1387/repro4.vhdl | 42 | ||||
-rwxr-xr-x | testsuite/gna/issue1387/testsuite.sh | 2 |
2 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/gna/issue1387/repro4.vhdl b/testsuite/gna/issue1387/repro4.vhdl new file mode 100644 index 000000000..2f09a60f4 --- /dev/null +++ b/testsuite/gna/issue1387/repro4.vhdl @@ -0,0 +1,42 @@ +package repro4 is + constant v : bit_vector := x"01"; + + function f1 (a : natural := v'length) return natural; + function f2 (a : natural := v'left) return natural; + function f3 (a : natural := v'right) return natural; + function f4 (a : natural := v'high) return natural; + function f5 (a : natural := v'low) return natural; + function f6 (a : boolean := v'ascending) return natural; +end; + +package body repro4 is + function f1 (a : natural := v'length) return natural is + begin + return 1; + end; + + function f2 (a : natural := v'left) return natural is + begin + return 1; + end; + + function f3 (a : natural := v'right) return natural is + begin + return 1; + end; + + function f4 (a : natural := v'high) return natural is + begin + return 1; + end; + + function f5 (a : natural := v'low) return natural is + begin + return 1; + end; + + function f6 (a : boolean := v'ascending) return natural is + begin + return 1; + end; +end; diff --git a/testsuite/gna/issue1387/testsuite.sh b/testsuite/gna/issue1387/testsuite.sh index 8c89d92cc..74921ddc7 100755 --- a/testsuite/gna/issue1387/testsuite.sh +++ b/testsuite/gna/issue1387/testsuite.sh @@ -9,6 +9,8 @@ analyze repro2.vhdl analyze repro3.vhdl elab_simulate repro3 +analyze repro4.vhdl + clean echo "Test successful" |