diff options
author | Tristan Gingold | 2016-01-07 19:50:39 +0100 |
---|---|---|
committer | Tristan Gingold | 2016-01-07 19:50:39 +0100 |
commit | 45f0ebbbbf65c7147dc6f524234b0fe5b90d56dc (patch) | |
tree | 6e827407fc6e3a0d405be7a5052fa3a1ccab7bb3 /testsuite/gna/issue18 | |
parent | bb29dc5b5e1e4aa0acf0352f8939b59fdc1513dd (diff) | |
download | ghdl-45f0ebbbbf65c7147dc6f524234b0fe5b90d56dc.tar.gz ghdl-45f0ebbbbf65c7147dc6f524234b0fe5b90d56dc.tar.bz2 ghdl-45f0ebbbbf65c7147dc6f524234b0fe5b90d56dc.zip |
Add reproducer for issue18.
Diffstat (limited to 'testsuite/gna/issue18')
-rw-r--r-- | testsuite/gna/issue18/fum.vhdl | 55 | ||||
-rw-r--r-- | testsuite/gna/issue18/integer_ambig.vhdl | 15 | ||||
-rwxr-xr-x | testsuite/gna/issue18/testsuite.sh | 12 |
3 files changed, 82 insertions, 0 deletions
diff --git a/testsuite/gna/issue18/fum.vhdl b/testsuite/gna/issue18/fum.vhdl new file mode 100644 index 0000000..54ce8c1 --- /dev/null +++ b/testsuite/gna/issue18/fum.vhdl @@ -0,0 +1,55 @@ +package fum is + type fie is protected + impure function foo return integer; + impure function foo(input: real) return integer; -- 4 + impure function foo return integer_vector; + impure function foo (input: real) return integer_vector; -- 6 + impure function foo (input: integer) return integer; + impure function foo(input: integer) return integer_vector; + + end protected fie; +end package; + +package body fum is + type fie is protected body + variable answer: integer := 42; + + impure function foo return integer is + begin + return answer; + end; + + impure function foo(input:real) return integer is + begin + return integer(input) + answer; + end; + + impure function foo return integer_vector is + variable conv_vector: integer_vector (0 to 1); + begin + conv_vector(0) := answer; + conv_vector(1) := 0; + return conv_vector; + end; + + impure function foo (input: real) return integer_vector is + variable conv_vector: integer_vector (0 to 1); + begin + conv_vector(0) := integer(input) + answer; + conv_vector(1) := 0; + end; + + impure function foo (input: integer) return integer is + begin + return answer + input; + end; + + impure function foo(input: integer) return integer_vector is + variable conv_vector: integer_vector (0 to 1); + begin + conv_vector(0) := input + answer; + conv_vector(1) := 0; + return conv_vector; + end; + end protected body fie; +end package body; diff --git a/testsuite/gna/issue18/integer_ambig.vhdl b/testsuite/gna/issue18/integer_ambig.vhdl new file mode 100644 index 0000000..cdf1e0e --- /dev/null +++ b/testsuite/gna/issue18/integer_ambig.vhdl @@ -0,0 +1,15 @@ +use work.fum.all; + +entity overload_index_issue is +end entity overload_index_issue ; +architecture dumbit_down of overload_index_issue is + shared variable fee: fie; +begin + + process + variable Data : integer ; + begin + Data := fee.foo(120.0); + wait; + end process; +end architecture dumbit_down; diff --git a/testsuite/gna/issue18/testsuite.sh b/testsuite/gna/issue18/testsuite.sh new file mode 100755 index 0000000..06323a6 --- /dev/null +++ b/testsuite/gna/issue18/testsuite.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 +analyze fum.vhdl +analyze integer_ambig.vhdl +elab_simulate overload_index_issue + +clean + +echo "Test successful" |