aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue25
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-01-25 08:09:02 +0100
committerTristan Gingold <tgingold@free.fr>2016-01-25 08:09:02 +0100
commit5aa273c620cc11176de64b545c54e3482a814bd6 (patch)
tree2b40bc4744820484bf682e1df83a5122760f8e36 /testsuite/gna/issue25
parentd41e95268769b160adc10324525ebefb88200d36 (diff)
downloadghdl-5aa273c620cc11176de64b545c54e3482a814bd6.tar.gz
ghdl-5aa273c620cc11176de64b545c54e3482a814bd6.tar.bz2
ghdl-5aa273c620cc11176de64b545c54e3482a814bd6.zip
Add testcase for issue25.
Diffstat (limited to 'testsuite/gna/issue25')
-rw-r--r--testsuite/gna/issue25/1_SecondaryUnit.vhdl58
-rw-r--r--testsuite/gna/issue25/2_SecondaryUnit.vhdl46
-rwxr-xr-xtestsuite/gna/issue25/testsuite.sh10
3 files changed, 114 insertions, 0 deletions
diff --git a/testsuite/gna/issue25/1_SecondaryUnit.vhdl b/testsuite/gna/issue25/1_SecondaryUnit.vhdl
new file mode 100644
index 000000000..731a88e94
--- /dev/null
+++ b/testsuite/gna/issue25/1_SecondaryUnit.vhdl
@@ -0,0 +1,58 @@
+-- This snippet causes an exception:
+-- PS H:\Austausch\PoC\temp\bugreport> C:\Tools\GHDL.new\bin\ghdl.exe -a -v .\1_SecondaryUnit.vhd
+-- .\1_SecondaryUnit.vhd:19:42: can't match physical literal with type physical type "t_angel"
+-- are_trees_equal: cannot handle IIR_KIND_UNIT_DECLARATION (*std_standard*:1:1)
+--
+-- ******************** GHDL Bug occured ****************************
+-- Please report this bug on https://github.com/tgingold/ghdl/issues
+-- GHDL release: GHDL 0.34dev (commit: 2016-01-20; git branch: paebbels/llvm'; hash: 3a8fd5b) [Dunoon edition]
+-- Compiled with GNAT Version: GPL 2015 (20150428-49)
+-- In directory: H:\Austausch\PoC\temp\bugreport\
+-- Command line:
+-- C:\Tools\GHDL.new\bin\ghdl.exe -a -v .\1_SecondaryUnit.vhd
+-- Exception TYPES.INTERNAL_ERROR raised
+-- Exception information:
+-- Exception name: TYPES.INTERNAL_ERROR
+-- Message: errorout.adb:66
+-- ******************************************************************
+--
+-- The "syntax" error is, that I forgot to rename '10 sec' in line 35
+
+package pkg is
+ type T_ANGEL is range INTEGER'low to INTEGER'high units
+ second;
+ minute = 60 second;
+ deg = 60 minute;
+ end units;
+
+ subtype T_PHASE is T_ANGEL range -360 deg to 360 deg;
+
+ function test1(Phase : T_PHASE := 10 second) return T_PHASE;
+ procedure test2(signal output : out T_PHASE; input : T_PHASE := 10.0 second);
+end package;
+
+package body pkg is
+ function test1(Phase : T_PHASE := 10 sec) return T_PHASE is
+ begin
+ return Phase + 1.0 deg;
+ end function;
+
+ procedure test2(signal output : out T_PHASE; input : T_PHASE := 10.0 second) is
+ begin
+ output <= input;
+ end procedure;
+end package body;
+
+
+use works.pkg.all;
+
+entity SecondaryUnit_tb is
+end entity;
+
+architecture test of SecondaryUnit_tb is
+ signal TestSignal1 : T_PHASE;
+ signal TestSignal2 : T_PHASE;
+begin
+ TestSignal1 <= test1(50.0 second);
+ test2(TestSignal2, TestSignal1);
+end architecture;
diff --git a/testsuite/gna/issue25/2_SecondaryUnit.vhdl b/testsuite/gna/issue25/2_SecondaryUnit.vhdl
new file mode 100644
index 000000000..0c9815459
--- /dev/null
+++ b/testsuite/gna/issue25/2_SecondaryUnit.vhdl
@@ -0,0 +1,46 @@
+-- This snippets reports that the specifications of test2 (line 17 and 26) are not identical.
+-- Line 17 was generated by line duplication in my editor ... strange
+-- Have I missed something?
+--
+-- PS H:\Austausch\PoC\temp\bugreport> C:\Tools\GHDL.new\bin\ghdl.exe -a -v .\2_SecondaryUnit.vhd
+-- .\2_SecondaryUnit.vhd:25:18: body of procedure "test2" does not conform with specification at .\2_SecondaryUnit.vhd:16:18
+--
+package pkg is
+ type T_ANGEL is range INTEGER'low to INTEGER'high units
+ second;
+ minute = 60 second;
+ deg = 60 minute;
+ end units;
+ subtype T_PHASE is T_ANGEL range -360 deg to 360 deg;
+
+ function test1(Phase : T_PHASE := 10 second) return T_PHASE;
+ procedure test2(signal output : out T_PHASE; input : T_PHASE := 10.0 second);
+end package;
+
+package body pkg is
+ function test1(Phase : T_PHASE := 10 second) return T_PHASE is
+ begin
+ return Phase + 1.0 deg;
+ end function;
+
+ procedure test2(signal output : out T_PHASE; input : T_PHASE := 10.0 second) is
+ begin
+ output <= input;
+ end procedure;
+end package body;
+
+
+use work.pkg.all;
+
+
+entity SecondaryUnit_tb is
+end entity;
+
+architecture test of SecondaryUnit_tb is
+ signal TestSignal1 : T_PHASE;
+ signal TestSignal2 : T_PHASE;
+begin
+ TestSignal1 <= test1(50.0 second);
+ test2(TestSignal2, TestSignal1);
+end architecture;
+
diff --git a/testsuite/gna/issue25/testsuite.sh b/testsuite/gna/issue25/testsuite.sh
new file mode 100755
index 000000000..5b081c82d
--- /dev/null
+++ b/testsuite/gna/issue25/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze_failure 1_SecondaryUnit.vhdl
+analyze 2_SecondaryUnit.vhdl
+
+clean
+
+echo "Test successful"