aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue2189/bug02.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/issue2189/bug02.vhdl')
-rw-r--r--testsuite/gna/issue2189/bug02.vhdl21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/gna/issue2189/bug02.vhdl b/testsuite/gna/issue2189/bug02.vhdl
new file mode 100644
index 000000000..c6dd7841b
--- /dev/null
+++ b/testsuite/gna/issue2189/bug02.vhdl
@@ -0,0 +1,21 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+use work.all;
+
+entity bug02 is
+end bug02;
+
+architecture rtl of bug02 is
+ FUNCTION weird (bw : integer range 2 to 32)
+ RETURN INTEGER IS
+ BEGIN
+ RETURN -(2**(bw - 1));
+ END weird;
+begin
+ process
+ begin
+ report to_string(weird(10));
+ wait;
+ end process;
+end architecture;