From 60e73a3a858b5c0ceb6d62de1f3fd0082fa125dc Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 15 May 2015 20:44:18 +0200 Subject: Testcase for ticket 65. --- testsuite/gna/ticket65/bug.vhdl | 18 ++++++++++++++++++ testsuite/gna/ticket65/bug1.vhdl | 17 +++++++++++++++++ testsuite/gna/ticket65/bug2.vhdl | 16 ++++++++++++++++ testsuite/gna/ticket65/testsuite.sh | 16 ++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 testsuite/gna/ticket65/bug.vhdl create mode 100644 testsuite/gna/ticket65/bug1.vhdl create mode 100644 testsuite/gna/ticket65/bug2.vhdl create mode 100755 testsuite/gna/ticket65/testsuite.sh (limited to 'testsuite') diff --git a/testsuite/gna/ticket65/bug.vhdl b/testsuite/gna/ticket65/bug.vhdl new file mode 100644 index 000000000..cf785e136 --- /dev/null +++ b/testsuite/gna/ticket65/bug.vhdl @@ -0,0 +1,18 @@ +entity ent is +end entity; + +architecture a of ent is +begin + main : process is + type enum_t is (value1, value2); + variable var : enum_t; + begin + var := enum_t'rightof(value2); -- CONSTRAINT_ERROR + var := enum_t'rightof(value1); -- Works + var := enum_t'leftof(value1); -- Works + var := enum_t'leftof(value2); -- Works + var := enum_t'rightof(var); -- cannot handle IIR_KIND_RIGHTOF_ATTRIBUTE + var := enum_t'leftof(var); -- cannot handle IIR_KIND_LEFTOF_ATTRIBUTE + wait; + end process; +end architecture; diff --git a/testsuite/gna/ticket65/bug1.vhdl b/testsuite/gna/ticket65/bug1.vhdl new file mode 100644 index 000000000..1af4cd191 --- /dev/null +++ b/testsuite/gna/ticket65/bug1.vhdl @@ -0,0 +1,17 @@ +entity ent1 is +end entity; + +architecture a of ent1 is +begin + main : process is + type enum_t is (value1, value2); + variable var : enum_t; + begin + var := enum_t'rightof(value1); -- Works + var := enum_t'leftof(value1); -- Error + var := enum_t'leftof(value2); -- Works + var := enum_t'rightof(var); -- cannot handle IIR_KIND_RIGHTOF_ATTRIBUTE + var := enum_t'leftof(var); -- cannot handle IIR_KIND_LEFTOF_ATTRIBUTE + wait; + end process; +end architecture; diff --git a/testsuite/gna/ticket65/bug2.vhdl b/testsuite/gna/ticket65/bug2.vhdl new file mode 100644 index 000000000..018f85e7a --- /dev/null +++ b/testsuite/gna/ticket65/bug2.vhdl @@ -0,0 +1,16 @@ +entity ent2 is +end entity; + +architecture a of ent2 is +begin + main : process is + type enum_t is (value1, value2); + variable var : enum_t; + begin + var := enum_t'rightof(value1); -- Works + var := enum_t'leftof(value2); -- Works + var := enum_t'rightof(var); -- cannot handle IIR_KIND_RIGHTOF_ATTRIBUTE + var := enum_t'leftof(var); -- cannot handle IIR_KIND_LEFTOF_ATTRIBUTE + wait; + end process; +end architecture; diff --git a/testsuite/gna/ticket65/testsuite.sh b/testsuite/gna/ticket65/testsuite.sh new file mode 100755 index 000000000..46b0fdb0b --- /dev/null +++ b/testsuite/gna/ticket65/testsuite.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze bug.vhdl +elab_simulate_failure ent + +analyze bug1.vhdl +elab_simulate_failure ent1 + +analyze bug2.vhdl +elab_simulate ent2 + +clean + +echo "Test successful" -- cgit v1.2.3