From ceac775f4fc250a6299022005109699d58b451e3 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 29 Jul 2016 03:59:15 +0200 Subject: Add testcase from issue #126 --- testsuite/gna/issue126/seg_fault.vhdl | 25 +++++++++++++++++++++++++ testsuite/gna/issue126/testsuite.sh | 13 +++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 testsuite/gna/issue126/seg_fault.vhdl create mode 100755 testsuite/gna/issue126/testsuite.sh (limited to 'testsuite/gna') diff --git a/testsuite/gna/issue126/seg_fault.vhdl b/testsuite/gna/issue126/seg_fault.vhdl new file mode 100644 index 000000000..dab7c14af --- /dev/null +++ b/testsuite/gna/issue126/seg_fault.vhdl @@ -0,0 +1,25 @@ +package pa is + type t is range 0 to 3; +end package; + +use work.pa.t; +package pb is + function f (a,b:t) return t ; + function "="(a,b:t) return boolean; +end package; + +use work.pa."+"; +-- This side note is not part of the bug report: with vhdl pre-2008 this use clause should be required (I think) and it is not +-- use work.pa."="; +package body pb is + function f (a,b:t) return t is begin return a+b; end function; + function "="(a,b:t) return boolean is begin return a=b; end function; +end package body; + +use work.pa.all; -- fails with and without this use clause +use work.pb.f; +use work.pb."="; -- this causes the problem +entity e is begin + assert f(1,2)=0 severity note; +end entity; +architecture a of e is begin end architecture; diff --git a/testsuite/gna/issue126/testsuite.sh b/testsuite/gna/issue126/testsuite.sh new file mode 100755 index 000000000..5d38dfe1f --- /dev/null +++ b/testsuite/gna/issue126/testsuite.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 +analyze seg_fault.vhdl +elab e + +# Do not simulate: infinite recursion. + +clean + +echo "Test successful" -- cgit v1.2.3