From d4ba25fa7fb5e7e110c5dbf567bd840e845ba834 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 2 Sep 2016 05:08:54 +0200 Subject: Add testcase for previous patch (very simple nested packages) --- testsuite/gna/bug052/tb.vhdl | 11 +++++++++++ testsuite/gna/bug052/tb_simple.vhdl | 11 +++++++++++ testsuite/gna/bug052/tb_simple1.vhdl | 12 ++++++++++++ testsuite/gna/bug052/tb_simple2.vhdl | 13 +++++++++++++ testsuite/gna/bug052/testsuite.sh | 18 ++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 testsuite/gna/bug052/tb.vhdl create mode 100644 testsuite/gna/bug052/tb_simple.vhdl create mode 100644 testsuite/gna/bug052/tb_simple1.vhdl create mode 100644 testsuite/gna/bug052/tb_simple2.vhdl create mode 100755 testsuite/gna/bug052/testsuite.sh (limited to 'testsuite/gna') 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" -- cgit v1.2.3