From 394c9b5f341cd4393a87acad72b933a6d4a56e2b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 23 Feb 2017 21:01:14 +0100 Subject: Add testcase for #293 Close #293 --- testsuite/gna/issue293/repro.vhdl | 27 +++++++++++++++++++++++++++ testsuite/gna/issue293/tb_test.vhdl | 24 ++++++++++++++++++++++++ testsuite/gna/issue293/testsuite.sh | 11 +++++++++++ 3 files changed, 62 insertions(+) create mode 100644 testsuite/gna/issue293/repro.vhdl create mode 100644 testsuite/gna/issue293/tb_test.vhdl create mode 100755 testsuite/gna/issue293/testsuite.sh diff --git a/testsuite/gna/issue293/repro.vhdl b/testsuite/gna/issue293/repro.vhdl new file mode 100644 index 000000000..1e12d6d7e --- /dev/null +++ b/testsuite/gna/issue293/repro.vhdl @@ -0,0 +1,27 @@ +library ieee; +use ieee.float_pkg.all; + +entity tb_test is + generic ( + runner_cfg : string := "h"); +end tb_test; + +architecture tb of tb_test is +begin + test_runner : process + -- Makes the implicit "=" directly visible. + alias fp32 is float32; + begin + assert not (zerofp = neg_zerofp) severity failure; + + wait; + end process test_runner; + + test_runner2 : process + -- Only the user-defined "=" is visible. + begin + assert zerofp = neg_zerofp severity failure; + + wait; + end process test_runner2; +end; diff --git a/testsuite/gna/issue293/tb_test.vhdl b/testsuite/gna/issue293/tb_test.vhdl new file mode 100644 index 000000000..5b17dda18 --- /dev/null +++ b/testsuite/gna/issue293/tb_test.vhdl @@ -0,0 +1,24 @@ +library vunit_lib; +context vunit_lib.vunit_context; + +library ieee; +use ieee.float_pkg.all; + +entity tb_test is + generic ( + runner_cfg : string); +end tb_test; + +architecture tb of tb_test is +begin + test_runner : process + alias fp32 is float32; + begin + test_runner_setup(runner, runner_cfg); + + assert zerofp = neg_zerofp; + + test_runner_cleanup(runner); + wait; + end process test_runner; +end; diff --git a/testsuite/gna/issue293/testsuite.sh b/testsuite/gna/issue293/testsuite.sh new file mode 100755 index 000000000..461451930 --- /dev/null +++ b/testsuite/gna/issue293/testsuite.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze repro.vhdl +elab_simulate tb_test + +clean + +echo "Test successful" -- cgit v1.2.3