aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-03-13 19:05:09 +0100
committerTristan Gingold <tgingold@free.fr>2015-03-13 19:05:09 +0100
commit9a549846d280fe5f65f6194946e041bb277ab8d5 (patch)
tree0962aff1dd44429f14016bf761d3173967a009cc /testsuite
parent39e693d639744c83d4ba7916ba2eaa6a28a19cee (diff)
downloadghdl-9a549846d280fe5f65f6194946e041bb277ab8d5.tar.gz
ghdl-9a549846d280fe5f65f6194946e041bb277ab8d5.tar.bz2
ghdl-9a549846d280fe5f65f6194946e041bb277ab8d5.zip
generic override: handle i32.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/ticket37/genint.vhdl15
-rwxr-xr-xtestsuite/gna/ticket37/testsuite.sh8
2 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/gna/ticket37/genint.vhdl b/testsuite/gna/ticket37/genint.vhdl
new file mode 100644
index 000000000..742d1093e
--- /dev/null
+++ b/testsuite/gna/ticket37/genint.vhdl
@@ -0,0 +1,15 @@
+package pkg is
+ subtype myint is integer range integer'low to 169;
+end pkg;
+
+use work.pkg.all;
+
+entity genint is
+ generic (val : myint := 5);
+end genint;
+
+architecture behav of genint is
+begin
+ assert val = -159 or val = 9 severity failure;
+end behav;
+
diff --git a/testsuite/gna/ticket37/testsuite.sh b/testsuite/gna/ticket37/testsuite.sh
index ea51e5c79..0bbd20769 100755
--- a/testsuite/gna/ticket37/testsuite.sh
+++ b/testsuite/gna/ticket37/testsuite.sh
@@ -7,6 +7,14 @@ elab_simulate dispgen
elab_simulate dispgen -gstr=Hello
+analyze genint.vhdl
+elab_simulate_failure genint
+
+simulate genint -gVAL=9
+simulate genint -gVal=-159
+
+simulate_failure genint -gval=200
+
clean
echo "Test successful"