From e6d3f2d007196dbddad119520c530454ab5a33c9 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 9 Jun 2015 20:16:23 +0200 Subject: Testcase for crash due to physical fp literals. --- testsuite/gna/bug15/phys.vhdl | 24 ++++++++++++++++++++++++ testsuite/gna/bug15/phys2.vhdl | 14 ++++++++++++++ testsuite/gna/bug15/testsuite.sh | 12 ++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 testsuite/gna/bug15/phys.vhdl create mode 100644 testsuite/gna/bug15/phys2.vhdl create mode 100755 testsuite/gna/bug15/testsuite.sh (limited to 'testsuite/gna') diff --git a/testsuite/gna/bug15/phys.vhdl b/testsuite/gna/bug15/phys.vhdl new file mode 100644 index 000000000..5af3359a4 --- /dev/null +++ b/testsuite/gna/bug15/phys.vhdl @@ -0,0 +1,24 @@ +package physical is + type FREQ is range 0 to INTEGER'high units + Hz; + kHz = 1000 Hz; + MHz = 1000 kHz; + GHz = 1000 MHz; +-- THz = 1000 GHz; + end units; +end package; + +entity tb is +end; + +use work.physical.all; + +architecture test of tb is + constant CLOCK_FREQ : FREQ := 100.0 MHz; + procedure p (a : freq := 1.0 Mhz) is + begin + end p; +begin + p (clock_freq); + -- empty +end architecture; diff --git a/testsuite/gna/bug15/phys2.vhdl b/testsuite/gna/bug15/phys2.vhdl new file mode 100644 index 000000000..3c0957fec --- /dev/null +++ b/testsuite/gna/bug15/phys2.vhdl @@ -0,0 +1,14 @@ +entity tb2 is +end; + +use work.physical.all; + +architecture test of tb2 is + constant CLOCK_FREQ : FREQ := MHz; + procedure p (a : freq) is + begin + end p; +begin + p (clock_freq); + -- empty +end architecture; diff --git a/testsuite/gna/bug15/testsuite.sh b/testsuite/gna/bug15/testsuite.sh new file mode 100755 index 000000000..59c4a42b3 --- /dev/null +++ b/testsuite/gna/bug15/testsuite.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze phys.vhdl +elab_simulate tb + +analyze phys2.vhdl +elab_simulate tb2 +clean + +echo "Test successful" -- cgit v1.2.3