From ce416ec62d20f1a592835efe5cbe49856d7085a2 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 6 Aug 2019 09:36:10 +0200 Subject: Add testcase for #877 --- testsuite/gna/issue877/aa.vhdl | 4 ++++ testsuite/gna/issue877/aa2.vhdl | 4 ++++ testsuite/gna/issue877/tb.vhdl | 9 +++++++++ testsuite/gna/issue877/tb2.vhdl | 14 ++++++++++++++ testsuite/gna/issue877/testsuite.sh | 12 ++++++++++++ 5 files changed, 43 insertions(+) create mode 100644 testsuite/gna/issue877/aa.vhdl create mode 100644 testsuite/gna/issue877/aa2.vhdl create mode 100644 testsuite/gna/issue877/tb.vhdl create mode 100644 testsuite/gna/issue877/tb2.vhdl create mode 100755 testsuite/gna/issue877/testsuite.sh (limited to 'testsuite/gna') diff --git a/testsuite/gna/issue877/aa.vhdl b/testsuite/gna/issue877/aa.vhdl new file mode 100644 index 000000000..daa4f0876 --- /dev/null +++ b/testsuite/gna/issue877/aa.vhdl @@ -0,0 +1,4 @@ +package aa is +constant a : integer_vector(0 to 1) := (0, 1); +constant b : integer_vector(0 to 0) := a(integer range 0 to 0); +end package aa; diff --git a/testsuite/gna/issue877/aa2.vhdl b/testsuite/gna/issue877/aa2.vhdl new file mode 100644 index 000000000..dd0b7086f --- /dev/null +++ b/testsuite/gna/issue877/aa2.vhdl @@ -0,0 +1,4 @@ +package aa2 is +constant a : bit_vector(0 to 1) := ('0', '1'); +constant b : bit_vector(0 to 0) := a(integer range 0 to 0); +end package aa2; diff --git a/testsuite/gna/issue877/tb.vhdl b/testsuite/gna/issue877/tb.vhdl new file mode 100644 index 000000000..e88ab827f --- /dev/null +++ b/testsuite/gna/issue877/tb.vhdl @@ -0,0 +1,9 @@ +entity tb is +end tb; + +architecture behav of tb is + constant msg : string := "hello world"; +begin + assert msg (positive range 1 to 5) = "hello" severity failure; + assert msg (positive range 7 to 11) = "world"; +end behav; diff --git a/testsuite/gna/issue877/tb2.vhdl b/testsuite/gna/issue877/tb2.vhdl new file mode 100644 index 000000000..e590992b0 --- /dev/null +++ b/testsuite/gna/issue877/tb2.vhdl @@ -0,0 +1,14 @@ +entity tb is +end tb; + +architecture behav of tb is + constant msg : string := "hello world"; + procedure chk (b : natural) + is + subtype my_rng is natural range 1 to b; + begin + assert msg (chk.my_rng) = "hello"; + end chk; +begin + chk(5); +end behav; diff --git a/testsuite/gna/issue877/testsuite.sh b/testsuite/gna/issue877/testsuite.sh new file mode 100755 index 000000000..7a4443d03 --- /dev/null +++ b/testsuite/gna/issue877/testsuite.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze aa2.vhdl + +analyze tb.vhdl +elab_simulate tb + +clean + +echo "Test successful" -- cgit v1.2.3