From acb6ffa4ea1eae70e3d9877cc485bb3fb82e3ea5 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 2 Jul 2020 18:33:17 +0200 Subject: testsuite/gna: add a test for #1387 --- testsuite/gna/issue1387/repro4.vhdl | 42 ++++++++++++++++++++++++++++++++++++ testsuite/gna/issue1387/testsuite.sh | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 testsuite/gna/issue1387/repro4.vhdl (limited to 'testsuite/gna') 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" -- cgit v1.2.3