summaryrefslogtreecommitdiff
path: root/testsuite/gna/ticket37
diff options
context:
space:
mode:
authorTristan Gingold2015-03-13 19:05:09 +0100
committerTristan Gingold2015-03-13 19:05:09 +0100
commit9a549846d280fe5f65f6194946e041bb277ab8d5 (patch)
tree0962aff1dd44429f14016bf761d3173967a009cc /testsuite/gna/ticket37
parent39e693d639744c83d4ba7916ba2eaa6a28a19cee (diff)
downloadghdl-9a549846d280fe5f65f6194946e041bb277ab8d5.tar.gz
ghdl-9a549846d280fe5f65f6194946e041bb277ab8d5.tar.bz2
ghdl-9a549846d280fe5f65f6194946e041bb277ab8d5.zip
generic override: handle i32.
Diffstat (limited to 'testsuite/gna/ticket37')
-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 0000000..742d109
--- /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 ea51e5c..0bbd207 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"