diff options
-rw-r--r-- | testsuite/gna/ticket31/tb2.vhdl | 12 | ||||
-rwxr-xr-x | testsuite/gna/ticket31/testsuite.sh | 13 | ||||
-rw-r--r-- | testsuite/gna/ticket31/top_phystest_simple.vhdl | 22 |
3 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/gna/ticket31/tb2.vhdl b/testsuite/gna/ticket31/tb2.vhdl new file mode 100644 index 000000000..4b1922067 --- /dev/null +++ b/testsuite/gna/ticket31/tb2.vhdl @@ -0,0 +1,12 @@ +entity Tb2 is +end; + +architecture top of Tb2 is + function get_m15 return real is + begin + return -1.5; + end get_m15; + constant int_2 : INTEGER := natural(get_m15); +begin + assert FALSE report "17 - int_2 (natural(-1.5)): " & INTEGER'image(int_2) severity note; +end; diff --git a/testsuite/gna/ticket31/testsuite.sh b/testsuite/gna/ticket31/testsuite.sh new file mode 100755 index 000000000..d71d3ef61 --- /dev/null +++ b/testsuite/gna/ticket31/testsuite.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze top_phystest_simple.vhdl +elab_simulate_failure top_physicaltest_simple + +analyze tb2.vhdl +elab_simulate_failure tb2 + +clean + +echo "Test successful" diff --git a/testsuite/gna/ticket31/top_phystest_simple.vhdl b/testsuite/gna/ticket31/top_phystest_simple.vhdl new file mode 100644 index 000000000..fd88e6273 --- /dev/null +++ b/testsuite/gna/ticket31/top_phystest_simple.vhdl @@ -0,0 +1,22 @@ +library IEEE; +use IEEE.STD_LOGIC_1164.ALL; +--use IEEE.MATH_REAL.all; + +entity Top_PhysicalTest_Simple is + port ( + Clock : in STD_LOGIC; + Input : in STD_LOGIC; + Output : out STD_LOGIC + ); +end; + +architecture top of Top_PhysicalTest_Simple is + constant int_1 : INTEGER := natural(1.5); + -- constant int_2 : INTEGER := integer(-1.5); + constant int_2 : INTEGER := natural(-1.5); +begin + assert FALSE report "16 - int_1 (natural(1.5)): " & INTEGER'image(int_1) severity note; + assert FALSE report "17 - int_2 (natural(-1.5)): " & INTEGER'image(int_2) severity note; + + Output <= Input when rising_edge(Clock); +end; |