diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-12-05 21:09:40 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-12-06 20:05:51 +0100 |
commit | e61719a3230d0170bcce86f69718795b47aa9757 (patch) | |
tree | 17491ed858b4f01184cefd3bb95e642ed938e4c5 /testsuite/gna/issue212 | |
parent | 927f45f785a7dc06b621850d7a61f471accc2405 (diff) | |
download | ghdl-e61719a3230d0170bcce86f69718795b47aa9757.tar.gz ghdl-e61719a3230d0170bcce86f69718795b47aa9757.tar.bz2 ghdl-e61719a3230d0170bcce86f69718795b47aa9757.zip |
Add testcase for #212
Diffstat (limited to 'testsuite/gna/issue212')
-rw-r--r-- | testsuite/gna/issue212/test.vhdl | 45 | ||||
-rwxr-xr-x | testsuite/gna/issue212/testsuite.sh | 9 |
2 files changed, 54 insertions, 0 deletions
diff --git a/testsuite/gna/issue212/test.vhdl b/testsuite/gna/issue212/test.vhdl new file mode 100644 index 000000000..c322888f2 --- /dev/null +++ b/testsuite/gna/issue212/test.vhdl @@ -0,0 +1,45 @@ +PACKAGE test_pkg IS + + TYPE test_record_t IS RECORD + number : integer; + END RECORD test_record_t; + + FUNCTION set_test_record_default + RETURN test_record_t; + + FUNCTION set_test_record ( + CONSTANT C_TEST : test_record_t := set_test_record_default) + RETURN test_record_t; + +END PACKAGE test_pkg; + +PACKAGE BODY test_pkg IS + + FUNCTION set_test_record_default + RETURN test_record_t IS + VARIABLE result : test_record_t; + BEGIN + result.number := 0; + RETURN result; + END set_test_record_default; + + FUNCTION set_test_record ( + CONSTANT C_TEST : test_record_t := set_test_record_default) + RETURN test_record_t IS + BEGIN + RETURN C_TEST; + END set_test_record; + +END PACKAGE BODY test_pkg; + +ENTITY test IS +END ENTITY test; + +LIBRARY work; +USE work.test_pkg.set_test_record; + +ARCHITECTURE rtl OF test IS + +BEGIN + +END ARCHITECTURE rtl; diff --git a/testsuite/gna/issue212/testsuite.sh b/testsuite/gna/issue212/testsuite.sh new file mode 100755 index 000000000..f8534f54e --- /dev/null +++ b/testsuite/gna/issue212/testsuite.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze test.vhdl + +clean + +echo "Test successful" |