aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-01-12 21:05:02 +0100
committerTristan Gingold <tgingold@free.fr>2017-01-13 18:57:24 +0100
commit1283370d289abafce1c42d0c952b759578ae7ac1 (patch)
tree4a5c70490e691b095627990a401217232efd5c25 /testsuite
parentf960173971d17c338b034d84cb80a4bf437a292c (diff)
downloadghdl-1283370d289abafce1c42d0c952b759578ae7ac1.tar.gz
ghdl-1283370d289abafce1c42d0c952b759578ae7ac1.tar.bz2
ghdl-1283370d289abafce1c42d0c952b759578ae7ac1.zip
Add testcase for #254
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue254/e.vhdl16
-rw-r--r--testsuite/gna/issue254/repro1.vhdl17
-rwxr-xr-xtestsuite/gna/issue254/testsuite.sh13
3 files changed, 46 insertions, 0 deletions
diff --git a/testsuite/gna/issue254/e.vhdl b/testsuite/gna/issue254/e.vhdl
new file mode 100644
index 000000000..214845932
--- /dev/null
+++ b/testsuite/gna/issue254/e.vhdl
@@ -0,0 +1,16 @@
+entity e is
+end entity;
+
+architecture a of e is
+begin
+ process
+ type LongInteger is range -2**47 to 2**47-1;
+ variable v : LongInteger;
+ begin
+ v := 12345678901;
+ report "v = " & LongInteger'image(v) severity note;
+ -- report "v = " & to_string(v) severity note; -- works
+ -- report "v = " & to_string(LongInteger'pos(v)) severity note; -- works
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/issue254/repro1.vhdl b/testsuite/gna/issue254/repro1.vhdl
new file mode 100644
index 000000000..49d396a7c
--- /dev/null
+++ b/testsuite/gna/issue254/repro1.vhdl
@@ -0,0 +1,17 @@
+entity repro1 is
+end entity;
+
+architecture a of repro1 is
+begin
+ process
+ type LongInteger is range -2**47 to 2**47-1;
+ variable v : LongInteger;
+ variable s : string (1 to 4);
+ begin
+ v := 12345678901;
+ report "v = " & LongInteger'image(v) severity note;
+ s := "1245";
+ assert LongInteger'Value (s) = 1245 severity failure;
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/issue254/testsuite.sh b/testsuite/gna/issue254/testsuite.sh
new file mode 100755
index 000000000..9ad6e510b
--- /dev/null
+++ b/testsuite/gna/issue254/testsuite.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze e.vhdl
+elab_simulate e
+
+analyze repro1.vhdl
+elab_simulate repro1
+
+clean
+
+echo "Test successful"