aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug20255/test_20255.vhd
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2013-12-18 05:53:22 +0100
committerTristan Gingold <tgingold@free.fr>2013-12-18 05:53:22 +0100
commitbd4aff0f670351c0652cf24e9b04361dc0e3a01c (patch)
treeafcc1050ac74fc64b5756e2550bc32ea61d1e7bb /testsuite/gna/bug20255/test_20255.vhd
parent5fde24d46fae799e6c0723850097a8fccd64d747 (diff)
downloadghdl-bd4aff0f670351c0652cf24e9b04361dc0e3a01c.tar.gz
ghdl-bd4aff0f670351c0652cf24e9b04361dc0e3a01c.tar.bz2
ghdl-bd4aff0f670351c0652cf24e9b04361dc0e3a01c.zip
Add initial testsuite, using regression tests from bugs or support
reported on gna.org
Diffstat (limited to 'testsuite/gna/bug20255/test_20255.vhd')
-rw-r--r--testsuite/gna/bug20255/test_20255.vhd32
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/gna/bug20255/test_20255.vhd b/testsuite/gna/bug20255/test_20255.vhd
new file mode 100644
index 000000000..d647f4639
--- /dev/null
+++ b/testsuite/gna/bug20255/test_20255.vhd
@@ -0,0 +1,32 @@
+entity e is
+end entity e;
+architecture test of e is
+signal s : string(1 to 9) := "2.345 Mhz";
+signal s2 : string(1 to 9) := "2345 khz ";
+
+ type frequency is range -2147483647 to 2147483647 units KHz;
+ MHz = 1000 KHz;
+ GHz = 1000 MHz;
+ end units;
+
+signal f : frequency := 3.456 MHz;
+
+begin
+ test : process is
+
+
+ begin
+ assert frequency'image(2 MHz) = "2000 khz";
+ assert frequency'image(f) = "3456 khz";
+
+ assert frequency'value("2000 khz") = 2 MHz ;
+ assert frequency'value("2345 khz") = 2.345 MHz ;
+ assert frequency'value("2 MHz") = 2000 kHz ;
+
+ assert frequency'value("2.345 Mhz") = 2345 kHz ;
+ assert frequency'value(s) = 2345 kHz ;
+ assert frequency'value(s2) = 2345 kHz ;
+ wait;
+ end process;
+
+end architecture test;