aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue368
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-06-14 06:44:58 +0200
committerTristan Gingold <tgingold@free.fr>2017-06-14 06:44:58 +0200
commitdddfb9512046198d9814a8d9ebf281d873daf1c1 (patch)
tree0556e6b8877af169c152bb9d40e0480399b832a6 /testsuite/gna/issue368
parent6cf4c2c34de713e166c5b3b463d02be53f8fb380 (diff)
downloadghdl-dddfb9512046198d9814a8d9ebf281d873daf1c1.tar.gz
ghdl-dddfb9512046198d9814a8d9ebf281d873daf1c1.tar.bz2
ghdl-dddfb9512046198d9814a8d9ebf281d873daf1c1.zip
Add reproducer for #368
Diffstat (limited to 'testsuite/gna/issue368')
-rw-r--r--testsuite/gna/issue368/bug.vhdl21
-rwxr-xr-xtestsuite/gna/issue368/testsuite.sh10
2 files changed, 31 insertions, 0 deletions
diff --git a/testsuite/gna/issue368/bug.vhdl b/testsuite/gna/issue368/bug.vhdl
new file mode 100644
index 000000000..9a02d7f2c
--- /dev/null
+++ b/testsuite/gna/issue368/bug.vhdl
@@ -0,0 +1,21 @@
+entity bug is
+end entity bug;
+
+architecture bug of bug is
+ signal uninitialized_real:real; -- yea--this is poor coding practice
+begin
+ process
+ begin
+ report "bug="&real'image(uninitialized_real); -- prints out initial value -1.797693134862316e308
+
+ wait for 1 ns;
+
+ uninitialized_real<=2.0*uninitialized_real; -- result is apparently IEEE Inf
+ wait for 0 ns; -- delta cycle to let new value take.
+
+ report "bug="&real'image(uninitialized_real); -- this line never completes
+ -- gets stuck in an infinite loop in grt.vstrings.to_string. Relevant source file: grt-vstrings.adb
+ -- Apparent reason for infinite loop--routine cannot determine exponent because the argument is Inf.
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/issue368/testsuite.sh b/testsuite/gna/issue368/testsuite.sh
new file mode 100755
index 000000000..8e2a7272f
--- /dev/null
+++ b/testsuite/gna/issue368/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze bug.vhdl
+elab_simulate_failure bug
+
+clean
+
+echo "Test successful"