aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-05-14 22:02:11 +0200
committerTristan Gingold <tgingold@free.fr>2015-05-14 22:02:11 +0200
commitca93319348bd9ae8f23dda91b85fb4dbd8c2f8ef (patch)
treeb7de86eb157a3e9cc5013e2267c2187683c4d607
parent15c60251e6d7f3d7f3aaa0a379f24f076e6bc047 (diff)
downloadghdl-ca93319348bd9ae8f23dda91b85fb4dbd8c2f8ef.tar.gz
ghdl-ca93319348bd9ae8f23dda91b85fb4dbd8c2f8ef.tar.bz2
ghdl-ca93319348bd9ae8f23dda91b85fb4dbd8c2f8ef.zip
Testcase for ticket 61.
-rw-r--r--testsuite/gna/ticket61/bug.vhdl34
-rwxr-xr-xtestsuite/gna/ticket61/testsuite.sh11
2 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/gna/ticket61/bug.vhdl b/testsuite/gna/ticket61/bug.vhdl
new file mode 100644
index 000000000..c4a4224fe
--- /dev/null
+++ b/testsuite/gna/ticket61/bug.vhdl
@@ -0,0 +1,34 @@
+entity ent is
+end entity;
+
+architecture a of ent is
+begin
+ main : process is
+ constant c : boolean := false;
+ variable v : boolean;
+
+ type enum is (a, b, short, \Extended\, \Weird\\Name\);
+ variable e : enum;
+ begin
+ report to_string(c); -- Cause TYPES.INTERNAL_ERROR
+ report to_string(false); -- Cause TYPES.INTERNAL_ERROR
+ report to_string(integer'(1)); -- Cause TYPES.INTERNAL_ERROR
+ report to_string(v); -- Works
+ report to_string(\Extended\);
+ report to_string(\Weird\\Name\);
+
+ assert to_string(CR) = (1 => CR) severity failure;
+ assert to_string(integer'(1)) = "1" severity failure;
+ assert to_string(integer'(-12)) = "-12" severity failure;
+ assert to_string(FaLse) = "false" severity failure;
+
+ assert to_string (\Extended\) = "Extended" severity failure;
+ assert to_string(\Weird\\Name\) = "Weird\Name" severity failure;
+ assert enum'image(\Weird\\Name\) = "\Weird\\Name\" severity failure;
+ e := \Weird\\Name\;
+ assert enum'image(e) = "\Weird\\Name\" severity failure;
+ report to_string(e);
+ assert to_string(e) = "Weird\Name" severity failure;
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/ticket61/testsuite.sh b/testsuite/gna/ticket61/testsuite.sh
new file mode 100755
index 000000000..6589b7cf3
--- /dev/null
+++ b/testsuite/gna/ticket61/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+
+analyze bug.vhdl
+elab_simulate ent
+clean
+
+echo "Test successful"