From 2921e66105f074630116c9de729fe364957f8a71 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 28 Feb 2022 10:25:16 +0100 Subject: [PATCH] Add regression test for invalid net data types Add regression tests that check that declaring a net of type class, dynamic array, queue or string result in an error. Signed-off-by: Lars-Peter Clausen --- ivtest/ivltests/net_class_fail.v | 12 ++++++++++++ ivtest/ivltests/net_darray_fail.v | 10 ++++++++++ ivtest/ivltests/net_queue_fail.v | 10 ++++++++++ ivtest/ivltests/net_string_fail.v | 10 ++++++++++ ivtest/regress-sv.list | 4 ++++ 5 files changed, 46 insertions(+) create mode 100644 ivtest/ivltests/net_class_fail.v create mode 100644 ivtest/ivltests/net_darray_fail.v create mode 100644 ivtest/ivltests/net_queue_fail.v create mode 100644 ivtest/ivltests/net_string_fail.v diff --git a/ivtest/ivltests/net_class_fail.v b/ivtest/ivltests/net_class_fail.v new file mode 100644 index 000000000..e38e670c3 --- /dev/null +++ b/ivtest/ivltests/net_class_fail.v @@ -0,0 +1,12 @@ +// Check that declaring a net of a class type results in an error + +module test; + class C; + endclass + + wire C x; + + initial begin + $display("FAILED"); + end +endmodule diff --git a/ivtest/ivltests/net_darray_fail.v b/ivtest/ivltests/net_darray_fail.v new file mode 100644 index 000000000..be7fe73a1 --- /dev/null +++ b/ivtest/ivltests/net_darray_fail.v @@ -0,0 +1,10 @@ +// Check that declaring a net of a dynamic array type results in an error + +module test; + + wire x[]; + + initial begin + $display("FAILED"); + end +endmodule diff --git a/ivtest/ivltests/net_queue_fail.v b/ivtest/ivltests/net_queue_fail.v new file mode 100644 index 000000000..e0f11c0be --- /dev/null +++ b/ivtest/ivltests/net_queue_fail.v @@ -0,0 +1,10 @@ +// Check that declaring a net of a queue type results in an error + +module test; + + wire x[$]; + + initial begin + $display("FAILED"); + end +endmodule diff --git a/ivtest/ivltests/net_string_fail.v b/ivtest/ivltests/net_string_fail.v new file mode 100644 index 000000000..a6c3af117 --- /dev/null +++ b/ivtest/ivltests/net_string_fail.v @@ -0,0 +1,10 @@ +// Check that declaring a net of string type results in an error + +module test; + + wire string x; + + initial begin + $display("FAILED"); + end +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index 4f73cad6a..d6f190e08 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -318,6 +318,10 @@ named_begin normal,-g2009 ivltests named_begin_fail CE,-g2009 ivltests named_fork normal,-g2009 ivltests named_fork_fail CE,-g2009 ivltests +net_class_fail CE,-g2005-sv ivltests +net_darray_fail CE,-g2005-sv ivltests +net_queue_fail CE,-g2005-sv ivltests +net_string_fail CE,-g2005-sv ivltests packeda normal,-g2009 ivltests packeda2 normal,-g2009 ivltests parameter_in_generate2 CE,-g2005-sv ivltests