diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-11-19 09:49:19 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-11-19 09:49:19 +0100 |
commit | 0872dc6307d0f1ead0f2e109ac8fd9293a0792dc (patch) | |
tree | 606c94ca15ab1ca9c8465a87cb388848a9758610 /testsuite/gna | |
parent | 15a35af9b7995d0c5bd72b0221dfe4880336b1ff (diff) | |
download | ghdl-0872dc6307d0f1ead0f2e109ac8fd9293a0792dc.tar.gz ghdl-0872dc6307d0f1ead0f2e109ac8fd9293a0792dc.tar.bz2 ghdl-0872dc6307d0f1ead0f2e109ac8fd9293a0792dc.zip |
Testcase for #465
Diffstat (limited to 'testsuite/gna')
-rw-r--r-- | testsuite/gna/issue465/e.vhdl | 18 | ||||
-rwxr-xr-x | testsuite/gna/issue465/testsuite.sh | 10 |
2 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/gna/issue465/e.vhdl b/testsuite/gna/issue465/e.vhdl new file mode 100644 index 000000000..551d0beda --- /dev/null +++ b/testsuite/gna/issue465/e.vhdl @@ -0,0 +1,18 @@ +entity e is end entity; +architecture h of e is + type r1 is record a :integer; end record; + type r2 is record b :integer; end record; + type r3 is record a :r1 ; end record; + type r4 is record a :r2 ; end record; + function f(a :integer := 1) return r3 is begin return (a=>(a=>a)); end function; + function f(a :integer := 2) return r4 is begin return (a=>(b=>a)); end function; + constant c1 :integer := f.a.a; + constant c2 :integer := f.a.b; + constant c3 :integer := f(3).a.a; + constant c4 :integer := f(4).a.b; +begin + assert false report integer'image(c1) severity note; + assert false report integer'image(c2) severity note; + assert false report integer'image(c3) severity note; + assert false report integer'image(c4) severity note; +end architecture; diff --git a/testsuite/gna/issue465/testsuite.sh b/testsuite/gna/issue465/testsuite.sh new file mode 100755 index 000000000..57536e34f --- /dev/null +++ b/testsuite/gna/issue465/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze e.vhdl +elab_simulate e + +clean + +echo "Test successful" |