diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-14 19:59:25 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-15 11:36:06 +0100 |
commit | aa440f398761c13c720f358198f8a4f93d880f61 (patch) | |
tree | 87e5f55d84ed5afc957dec7bfa29f1002d4014dd | |
parent | 3ed03181ff403e2805d36c425b1e3aa5725fe3d7 (diff) | |
download | ghdl-aa440f398761c13c720f358198f8a4f93d880f61.tar.gz ghdl-aa440f398761c13c720f358198f8a4f93d880f61.tar.bz2 ghdl-aa440f398761c13c720f358198f8a4f93d880f61.zip |
testsuite/gna/bug081: add tests for previous commit
-rw-r--r-- | testsuite/gna/bug081/elab_func.vhdl | 11 | ||||
-rw-r--r-- | testsuite/gna/bug081/elab_prot.vhdl | 23 | ||||
-rwxr-xr-x | testsuite/gna/bug081/testsuite.sh | 2 |
3 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/gna/bug081/elab_func.vhdl b/testsuite/gna/bug081/elab_func.vhdl new file mode 100644 index 000000000..8a951837c --- /dev/null +++ b/testsuite/gna/bug081/elab_func.vhdl @@ -0,0 +1,11 @@ +package elab_func is + function f return natural; +end elab_func; + +package body elab_func is + constant c : natural := f; + function f return natural is + begin + return 5; + end f; +end elab_func; diff --git a/testsuite/gna/bug081/elab_prot.vhdl b/testsuite/gna/bug081/elab_prot.vhdl new file mode 100644 index 000000000..d9516ff12 --- /dev/null +++ b/testsuite/gna/bug081/elab_prot.vhdl @@ -0,0 +1,23 @@ +package prot_pkg is + type myprot is protected + impure function get return natural; + procedure set (val : natural); + end protected; +end prot_pkg; + +package body prot_pkg is + shared variable v: myprot; + + type myprot is protected body + variable var : natural; + impure function get return natural is + begin + return var; + end get; + + procedure set (val : natural) is + begin + var := val; + end set; + end protected body myprot; +end prot_pkg; diff --git a/testsuite/gna/bug081/testsuite.sh b/testsuite/gna/bug081/testsuite.sh index 0fec0adad..96c1d80b9 100755 --- a/testsuite/gna/bug081/testsuite.sh +++ b/testsuite/gna/bug081/testsuite.sh @@ -3,6 +3,8 @@ . ../../testenv.sh analyze_failure -Werror=elaboration dummy.vhdl +analyze_failure -Werror=elaboration elab_func.vhdl +analyze_failure --std=08 -Werror=elaboration elab_prot.vhdl analyze dummy.vhdl elab_simulate_failure dummyentity |