-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |