diff --git a/ivtest/ivltests/sv_typedef_circular1.v b/ivtest/ivltests/sv_typedef_circular1.v new file mode 100644 index 000000000..998a21a50 --- /dev/null +++ b/ivtest/ivltests/sv_typedef_circular1.v @@ -0,0 +1,14 @@ +// Check that circular type definitions are detected and an error is reported. + +module test; + typedef T1; + typedef T1 T2; + typedef T2 T1; + + T2 x; + + initial begin + $display("FAILED"); + end + +endmodule diff --git a/ivtest/ivltests/sv_typedef_circular2.v b/ivtest/ivltests/sv_typedef_circular2.v new file mode 100644 index 000000000..638744e20 --- /dev/null +++ b/ivtest/ivltests/sv_typedef_circular2.v @@ -0,0 +1,18 @@ +// Check that longer chains of circular type definitions are detected as an +// error. + +module test; + + typedef T1; + + typedef struct packed { + T1 x; + } T2; + + typedef T2 [1:0] T3; + + typedef T3 T1; + + T1 x; + +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index 7738d2119..f9456c777 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -716,6 +716,8 @@ sv_typedef_array_base2 normal,-g2009 ivltests sv_typedef_array_base3 normal,-g2009 ivltests sv_typedef_array_base4 normal,-g2009 ivltests sv_typedef_chained normal,-g2009 ivltests +sv_typedef_circular1 CE,-g2009 ivltests +sv_typedef_circular2 CE,-g2009 ivltests sv_typedef_darray_base1 normal,-g2009 ivltests sv_typedef_darray_base2 normal,-g2009 ivltests sv_typedef_darray_base3 normal,-g2009 ivltests