aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-09-02 05:08:54 +0200
committerTristan Gingold <tgingold@free.fr>2016-09-03 14:57:27 +0200
commitd4ba25fa7fb5e7e110c5dbf567bd840e845ba834 (patch)
treec709e5ca1343d9bd751bcacf02d94f5fe66a9dc6 /testsuite
parent1dc63dae4baf052864bd16bb19fe89aed3ecabba (diff)
downloadghdl-d4ba25fa7fb5e7e110c5dbf567bd840e845ba834.tar.gz
ghdl-d4ba25fa7fb5e7e110c5dbf567bd840e845ba834.tar.bz2
ghdl-d4ba25fa7fb5e7e110c5dbf567bd840e845ba834.zip
Add testcase for previous patch (very simple nested packages)
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/bug052/tb.vhdl11
-rw-r--r--testsuite/gna/bug052/tb_simple.vhdl11
-rw-r--r--testsuite/gna/bug052/tb_simple1.vhdl12
-rw-r--r--testsuite/gna/bug052/tb_simple2.vhdl13
-rwxr-xr-xtestsuite/gna/bug052/testsuite.sh18
5 files changed, 65 insertions, 0 deletions
diff --git a/testsuite/gna/bug052/tb.vhdl b/testsuite/gna/bug052/tb.vhdl
new file mode 100644
index 000000000..5b266ef04
--- /dev/null
+++ b/testsuite/gna/bug052/tb.vhdl
@@ -0,0 +1,11 @@
+entity tb is
+ package pkg1 is
+ constant c : natural := 5;
+ end pkg1;
+end tb;
+
+architecture behav of tb is
+begin
+ assert pkg1.c = 5 severity failure;
+ assert pkg1.c /= 5 report "value is correct" severity note;
+end behav;
diff --git a/testsuite/gna/bug052/tb_simple.vhdl b/testsuite/gna/bug052/tb_simple.vhdl
new file mode 100644
index 000000000..4ba82f6b0
--- /dev/null
+++ b/testsuite/gna/bug052/tb_simple.vhdl
@@ -0,0 +1,11 @@
+entity tb_simple is
+ package pkg1 is
+ constant c : natural := 5;
+ end pkg1;
+end tb_simple;
+
+architecture behav of tb_simple is
+begin
+ assert pkg1.c = 5 severity failure;
+ assert pkg1.c /= 5 report "value is correct" severity note;
+end behav;
diff --git a/testsuite/gna/bug052/tb_simple1.vhdl b/testsuite/gna/bug052/tb_simple1.vhdl
new file mode 100644
index 000000000..636f62802
--- /dev/null
+++ b/testsuite/gna/bug052/tb_simple1.vhdl
@@ -0,0 +1,12 @@
+entity tb_simple1 is
+ generic (v : natural := 4);
+ package pkg1 is
+ constant c : natural := v + 1;
+ end pkg1;
+end tb_simple1;
+
+architecture behav of tb_simple1 is
+begin
+ assert pkg1.c = 5 severity failure;
+ assert pkg1.c /= 5 report "value is correct" severity note;
+end behav;
diff --git a/testsuite/gna/bug052/tb_simple2.vhdl b/testsuite/gna/bug052/tb_simple2.vhdl
new file mode 100644
index 000000000..e137dd070
--- /dev/null
+++ b/testsuite/gna/bug052/tb_simple2.vhdl
@@ -0,0 +1,13 @@
+entity tb_simple2 is
+ generic (v : natural := 4);
+ package pkg1 is
+ constant c : natural := v + 1;
+ end pkg1;
+ constant c : natural := v - 1;
+end;
+
+architecture behav of tb_simple2 is
+begin
+ assert pkg1.c = 5 and c = 3 severity failure;
+ assert not (pkg1.c = 5 and c = 3) report "value is correct" severity note;
+end behav;
diff --git a/testsuite/gna/bug052/testsuite.sh b/testsuite/gna/bug052/testsuite.sh
new file mode 100755
index 000000000..2c0b5185e
--- /dev/null
+++ b/testsuite/gna/bug052/testsuite.sh
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+
+analyze tb_simple.vhdl
+elab_simulate tb_simple
+
+analyze tb_simple1.vhdl
+elab_simulate tb_simple1
+
+analyze tb_simple2.vhdl
+elab_simulate tb_simple2
+
+clean
+
+echo "Test successful"