From 8187bf58f7fa74ea407f9ce47aec8c48aa534b91 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 25 Dec 2022 19:26:52 -0800 Subject: [PATCH] Add regression test for macros with multi-line comments Check that multi-line comments are supported in macros. Signed-off-by: Lars-Peter Clausen --- ivtest/ivltests/macro_comment_multiline.v | 23 +++++++++++++++++++++++ ivtest/regress-vlg.list | 1 + 2 files changed, 24 insertions(+) create mode 100644 ivtest/ivltests/macro_comment_multiline.v diff --git a/ivtest/ivltests/macro_comment_multiline.v b/ivtest/ivltests/macro_comment_multiline.v new file mode 100644 index 000000000..3a7c4b18a --- /dev/null +++ b/ivtest/ivltests/macro_comment_multiline.v @@ -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 diff --git a/ivtest/regress-vlg.list b/ivtest/regress-vlg.list index d3fb4870d..977970c83 100644 --- a/ivtest/regress-vlg.list +++ b/ivtest/regress-vlg.list @@ -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