aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue2189/repro01.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/issue2189/repro01.vhdl')
-rw-r--r--testsuite/gna/issue2189/repro01.vhdl18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/gna/issue2189/repro01.vhdl b/testsuite/gna/issue2189/repro01.vhdl
new file mode 100644
index 000000000..55e3fc455
--- /dev/null
+++ b/testsuite/gna/issue2189/repro01.vhdl
@@ -0,0 +1,18 @@
+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
+ constant c : integer := weird (10);
+ begin
+ report natural'image(c);
+ assert c = -512 severity failure;
+ wait;
+ end process;
+end architecture;