summaryrefslogtreecommitdiff
path: root/testsuite/gna/ticket65
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/ticket65')
-rw-r--r--testsuite/gna/ticket65/bug.vhdl18
-rw-r--r--testsuite/gna/ticket65/bug1.vhdl17
-rw-r--r--testsuite/gna/ticket65/bug2.vhdl16
-rwxr-xr-xtestsuite/gna/ticket65/testsuite.sh16
4 files changed, 67 insertions, 0 deletions
diff --git a/testsuite/gna/ticket65/bug.vhdl b/testsuite/gna/ticket65/bug.vhdl
new file mode 100644
index 0000000..cf785e1
--- /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 0000000..1af4cd1
--- /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 0000000..018f85e
--- /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 0000000..46b0fdb
--- /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"