aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-08-07 07:43:27 +0200
committerTristan Gingold <tgingold@free.fr>2022-08-07 10:00:14 +0200
commit67cfeff9665ff2a97108d6840a5dfc10ce695658 (patch)
tree0315a69e3424543e041910772b7d615fbecc2c65 /testsuite
parent6ccf73f59f9945974c63a47b5b295a37627fae91 (diff)
downloadghdl-67cfeff9665ff2a97108d6840a5dfc10ce695658.tar.gz
ghdl-67cfeff9665ff2a97108d6840a5dfc10ce695658.tar.bz2
ghdl-67cfeff9665ff2a97108d6840a5dfc10ce695658.zip
testsuite/gna: add a test for #2165
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue2165/e.vhdl13
-rwxr-xr-xtestsuite/gna/issue2165/testsuite.sh13
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/gna/issue2165/e.vhdl b/testsuite/gna/issue2165/e.vhdl
new file mode 100644
index 000000000..1938ade32
--- /dev/null
+++ b/testsuite/gna/issue2165/e.vhdl
@@ -0,0 +1,13 @@
+entity e is end;
+architecture a of e is
+
+ -- Body mismatches declaration because 'arg' is not marked constant.
+ -- However constant is the default value when not specified
+ function f1(constant arg : bit) return bit;
+ function f1( arg : bit) return bit
+ is
+ begin
+ return '0';
+ end;
+begin
+end;
diff --git a/testsuite/gna/issue2165/testsuite.sh b/testsuite/gna/issue2165/testsuite.sh
new file mode 100755
index 000000000..4545d99cc
--- /dev/null
+++ b/testsuite/gna/issue2165/testsuite.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=93
+analyze_failure e.vhdl
+
+export GHDL_STD_FLAGS=--std=93c
+analyze e.vhdl
+
+clean
+
+echo "Test successful"