diff options
author | Tristan Gingold <gingold@adacore.com> | 2016-09-10 06:43:02 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-09-12 20:28:23 +0200 |
commit | 14396514c4822239dfdd18dd42d43c75ec9c60ae (patch) | |
tree | 98fb3803ab3a5cb3b20d33dcc73e1c51d1c9706f /testsuite | |
parent | 1fd4397098c1bb94c1ce6c2081fa138518dca61f (diff) | |
download | ghdl-14396514c4822239dfdd18dd42d43c75ec9c60ae.tar.gz ghdl-14396514c4822239dfdd18dd42d43c75ec9c60ae.tar.bz2 ghdl-14396514c4822239dfdd18dd42d43c75ec9c60ae.zip |
Add testcase for generic packages.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gna/bug054/gen1.vhdl | 26 | ||||
-rw-r--r-- | testsuite/gna/bug054/gen2.vhdl | 38 | ||||
-rw-r--r-- | testsuite/gna/bug054/gen3.vhdl | 38 | ||||
-rw-r--r-- | testsuite/gna/bug054/gen4.vhdl | 38 | ||||
-rwxr-xr-x | testsuite/gna/bug054/testsuite.sh | 14 | ||||
-rw-r--r-- | testsuite/gna/bug055/gen1-body.vhdl | 6 | ||||
-rw-r--r-- | testsuite/gna/bug055/gen1.vhdl | 5 | ||||
-rw-r--r-- | testsuite/gna/bug055/gen2-body.vhdl | 8 | ||||
-rw-r--r-- | testsuite/gna/bug055/gen2.vhdl | 5 | ||||
-rw-r--r-- | testsuite/gna/bug055/pkg1.vhdl | 1 | ||||
-rw-r--r-- | testsuite/gna/bug055/pkg2.vhdl | 1 | ||||
-rw-r--r-- | testsuite/gna/bug055/tb-behav.vhdl | 4 | ||||
-rw-r--r-- | testsuite/gna/bug055/tb.vhdl | 2 | ||||
-rwxr-xr-x | testsuite/gna/bug055/testsuite.sh | 16 |
14 files changed, 202 insertions, 0 deletions
diff --git a/testsuite/gna/bug054/gen1.vhdl b/testsuite/gna/bug054/gen1.vhdl new file mode 100644 index 000000000..049763691 --- /dev/null +++ b/testsuite/gna/bug054/gen1.vhdl @@ -0,0 +1,26 @@ +package gen1 is + generic (v : natural); + + function get return natural; +end gen1; + +package body gen1 is + function get return natural is + begin + return v; + end get; +end gen1; + +package gen2 is + generic (package pkg is new work.gen1 generic map (<>)); + + function get2 return natural; +end gen2; + +package body gen2 is + + function get2 return natural is + begin + return pkg.get; + end get2; +end gen2; diff --git a/testsuite/gna/bug054/gen2.vhdl b/testsuite/gna/bug054/gen2.vhdl new file mode 100644 index 000000000..a9543aaae --- /dev/null +++ b/testsuite/gna/bug054/gen2.vhdl @@ -0,0 +1,38 @@ +package gen1 is + generic (v : natural := 5); + + function get return natural; +end gen1; + +package body gen1 is + function get return natural is + begin + return v; + end get; +end gen1; + +package gen2 is + generic (package pkg is new work.gen1 generic map (<>)); + + function get2 return natural; +end gen2; + +package body gen2 is + use pkg.all; + + function get2 return natural is + begin + return get; + end get2; +end gen2; + +package pkg1 is new work.gen1; +package pkg2 is new work.gen2 generic map (work.pkg1); + +entity tb is +end tb; + +architecture behav of tb is +begin + assert work.pkg2.get2 = 5; +end behav; diff --git a/testsuite/gna/bug054/gen3.vhdl b/testsuite/gna/bug054/gen3.vhdl new file mode 100644 index 000000000..ca4109d84 --- /dev/null +++ b/testsuite/gna/bug054/gen3.vhdl @@ -0,0 +1,38 @@ +package gen1 is + generic (v : natural := 5); + + function get return natural; +end gen1; + +package body gen1 is + function get return natural is + begin + return v; + end get; +end gen1; + +package gen2 is + generic (package pkg is new work.gen1 generic map (<>)); + + function get2 return natural; +end gen2; + +package body gen2 is + use pkg.all; + + function get2 return natural is + begin + return get; + end get2; +end gen2; + +package pkg1 is new work.gen1; +package pkg2 is new work.gen2 generic map (pkg1); + +entity tb is +end tb; + +architecture behav of tb is +begin + assert work.pkg2.get2 = 5; +end behav; diff --git a/testsuite/gna/bug054/gen4.vhdl b/testsuite/gna/bug054/gen4.vhdl new file mode 100644 index 000000000..a9543aaae --- /dev/null +++ b/testsuite/gna/bug054/gen4.vhdl @@ -0,0 +1,38 @@ +package gen1 is + generic (v : natural := 5); + + function get return natural; +end gen1; + +package body gen1 is + function get return natural is + begin + return v; + end get; +end gen1; + +package gen2 is + generic (package pkg is new work.gen1 generic map (<>)); + + function get2 return natural; +end gen2; + +package body gen2 is + use pkg.all; + + function get2 return natural is + begin + return get; + end get2; +end gen2; + +package pkg1 is new work.gen1; +package pkg2 is new work.gen2 generic map (work.pkg1); + +entity tb is +end tb; + +architecture behav of tb is +begin + assert work.pkg2.get2 = 5; +end behav; diff --git a/testsuite/gna/bug054/testsuite.sh b/testsuite/gna/bug054/testsuite.sh new file mode 100755 index 000000000..d8200ef1c --- /dev/null +++ b/testsuite/gna/bug054/testsuite.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 + +analyze gen1.vhdl +analyze gen2.vhdl +analyze_failure gen3.vhdl +analyze gen4.vhdl + +clean + +echo "Test successful" diff --git a/testsuite/gna/bug055/gen1-body.vhdl b/testsuite/gna/bug055/gen1-body.vhdl new file mode 100644 index 000000000..ee0c8e962 --- /dev/null +++ b/testsuite/gna/bug055/gen1-body.vhdl @@ -0,0 +1,6 @@ +package body gen1 is + function get return natural is + begin + return v; + end get; +end gen1; diff --git a/testsuite/gna/bug055/gen1.vhdl b/testsuite/gna/bug055/gen1.vhdl new file mode 100644 index 000000000..5d7062ab3 --- /dev/null +++ b/testsuite/gna/bug055/gen1.vhdl @@ -0,0 +1,5 @@ +package gen1 is + generic (v : natural := 5); + + function get return natural; +end gen1; diff --git a/testsuite/gna/bug055/gen2-body.vhdl b/testsuite/gna/bug055/gen2-body.vhdl new file mode 100644 index 000000000..372a71645 --- /dev/null +++ b/testsuite/gna/bug055/gen2-body.vhdl @@ -0,0 +1,8 @@ +package body gen2 is + use pkg.all; + + function get2 return natural is + begin + return get; + end get2; +end gen2; diff --git a/testsuite/gna/bug055/gen2.vhdl b/testsuite/gna/bug055/gen2.vhdl new file mode 100644 index 000000000..e7c7efe1a --- /dev/null +++ b/testsuite/gna/bug055/gen2.vhdl @@ -0,0 +1,5 @@ +package gen2 is + generic (package pkg is new work.gen1 generic map (<>)); + + function get2 return natural; +end gen2; diff --git a/testsuite/gna/bug055/pkg1.vhdl b/testsuite/gna/bug055/pkg1.vhdl new file mode 100644 index 000000000..3219ee3f0 --- /dev/null +++ b/testsuite/gna/bug055/pkg1.vhdl @@ -0,0 +1 @@ +package pkg1 is new work.gen1; diff --git a/testsuite/gna/bug055/pkg2.vhdl b/testsuite/gna/bug055/pkg2.vhdl new file mode 100644 index 000000000..c466485da --- /dev/null +++ b/testsuite/gna/bug055/pkg2.vhdl @@ -0,0 +1 @@ +package pkg2 is new work.gen2 generic map (work.pkg1); diff --git a/testsuite/gna/bug055/tb-behav.vhdl b/testsuite/gna/bug055/tb-behav.vhdl new file mode 100644 index 000000000..86c4f247c --- /dev/null +++ b/testsuite/gna/bug055/tb-behav.vhdl @@ -0,0 +1,4 @@ +architecture behav of tb is +begin + assert work.pkg2.get2 = 5; +end behav; diff --git a/testsuite/gna/bug055/tb.vhdl b/testsuite/gna/bug055/tb.vhdl new file mode 100644 index 000000000..2aed1a994 --- /dev/null +++ b/testsuite/gna/bug055/tb.vhdl @@ -0,0 +1,2 @@ +entity tb is +end tb; diff --git a/testsuite/gna/bug055/testsuite.sh b/testsuite/gna/bug055/testsuite.sh new file mode 100755 index 000000000..c80cb0d7d --- /dev/null +++ b/testsuite/gna/bug055/testsuite.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 + +analyze gen1.vhdl +analyze gen2.vhdl +analyze_failure pkg1.vhdl + +analyze gen1-body.vhdl +analyze pkg1.vhdl + +clean + +echo "Test successful" |