Add regression test for macros with multi-line comments

Check that multi-line comments are supported in macros.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-12-25 19:26:52 -08:00
parent 109b794253
commit 8187bf58f7
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,23 @@
// Check that multi-line comments in macros are supported. Including some corner
// cases like another comment start in the comment.
`define test(a, b, c) \
(a + /* these is some \
multi line */ b /* comment \
that goes on \
and on */ ) /* and some more \
\
// and even has a comments \
/* in the comment */ * c
module test;
initial begin
if (`test(1, 2, 3) === 9) begin
$display("PASSED");
end else begin
$display("FAILED");
end
end
endmodule

View File

@ -638,6 +638,7 @@ macro_args CO,-yivltests ivltests
macro_comment1 normal ivltests
macro_comment2 normal ivltests
macro_comment3 normal ivltests
macro_comment_multiline normal ivltests
macro_redefinition normal,-Wmacro-redefinition ivltests gold=macro_redefinition.gold
macro_replacement normal,-Wmacro-replacement ivltests gold=macro_replacement.gold
macsub normal ivltests