From 57612b1e15ceef2c7b2a43e2262493d010199d6b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 28 May 2019 08:00:40 +0200 Subject: vhdl: add testcase for previous patch. --- testsuite/gna/issue613/t87.vhdl | 17 +++++++++++++++++ testsuite/gna/issue613/testsuite.sh | 10 ++++++++++ 2 files changed, 27 insertions(+) create mode 100644 testsuite/gna/issue613/t87.vhdl (limited to 'testsuite/gna') diff --git a/testsuite/gna/issue613/t87.vhdl b/testsuite/gna/issue613/t87.vhdl new file mode 100644 index 000000000..847bf4e47 --- /dev/null +++ b/testsuite/gna/issue613/t87.vhdl @@ -0,0 +1,17 @@ +entity t87 is +end; + +architecture behav of t87 is + constant t1 : time := 1 ns; + constant t2 : natural := time'pos (t1); +begin + assert t1 = 1000 ps; + process + variable v : natural; + begin + -- Time resolution must be ps + v := time'pos(ps); + assert v = 1 severity failure; + wait; + end process; +end behav; diff --git a/testsuite/gna/issue613/testsuite.sh b/testsuite/gna/issue613/testsuite.sh index 90e38214a..4fb7d0126 100755 --- a/testsuite/gna/issue613/testsuite.sh +++ b/testsuite/gna/issue613/testsuite.sh @@ -17,6 +17,16 @@ else elab_simulate --time-resolution=us ent elab_simulate --time-resolution=auto ent + + analyze t87.vhdl + elab_simulate --time-resolution=ps t87 + elab_simulate --time-resolution=auto t87 + clean + + GHDL_STD_FLAGS=--std=87 + analyze t87.vhdl + elab_simulate --time-resolution=ps t87 + elab_simulate_failure --time-resolution=auto t87 clean fi -- cgit v1.2.3