aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue683/repro.vhdl12
-rw-r--r--testsuite/gna/issue683/repro64.vhdl14
-rwxr-xr-xtestsuite/gna/issue683/testsuite.sh15
3 files changed, 41 insertions, 0 deletions
diff --git a/testsuite/gna/issue683/repro.vhdl b/testsuite/gna/issue683/repro.vhdl
new file mode 100644
index 000000000..cdcc4dc5e
--- /dev/null
+++ b/testsuite/gna/issue683/repro.vhdl
@@ -0,0 +1,12 @@
+entity repro is
+end repro;
+
+architecture behav of repro is
+ function exp2 (b : integer) return integer is
+ begin
+ return 2**b;
+ end exp2;
+begin
+ assert exp2(3) = 8 severity failure;
+ assert exp2(31) > 0 severity failure;
+end behav;
diff --git a/testsuite/gna/issue683/repro64.vhdl b/testsuite/gna/issue683/repro64.vhdl
new file mode 100644
index 000000000..72181523d
--- /dev/null
+++ b/testsuite/gna/issue683/repro64.vhdl
@@ -0,0 +1,14 @@
+entity repro64 is
+end repro64;
+
+architecture behav of repro64 is
+ type integer64 is range -2**62 to 2**62 - 2;
+
+ function exp2 (b : integer) return integer64 is
+ begin
+ return 2**b;
+ end exp2;
+begin
+ assert exp2(3) = 8 severity failure;
+ assert exp2(31) = 2**31 severity failure;
+end behav;
diff --git a/testsuite/gna/issue683/testsuite.sh b/testsuite/gna/issue683/testsuite.sh
new file mode 100755
index 000000000..b8c5faad8
--- /dev/null
+++ b/testsuite/gna/issue683/testsuite.sh
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze repro.vhdl
+elab_simulate_failure repro
+
+analyze repro64.vhdl
+elab_simulate repro64
+
+clean
+
+echo "Test successful"
+
+