diff --git a/sv-parser-pp/testcases/expected/undefineall.sv b/sv-parser-pp/testcases/expected/undefineall.sv new file mode 100644 index 0000000..c711d39 --- /dev/null +++ b/sv-parser-pp/testcases/expected/undefineall.sv @@ -0,0 +1,29 @@ +// IEEE1800-2017 Clause 22.5.2 +// The directive `undef shall undefine the specified text macro if previously +// defined by a `define compiler directive within the compilation unit. An +// attempt to undefine a text macro that was not previously defined using a +// `define compiler directive can issue a warning. +`undef FOO +`undef FOO// Comment +`undef FOO // Comment + +`define FOO foo +`define BAR bar +// AAA +// This block SHOULD be emitted from the preprocessor. + + +// BBB +// This block SHOULD be emitted from the preprocessor. + + + +`undefineall + +// CCC +// This block SHOULD be emitted from the preprocessor. + + +// DDD +// This block SHOULD be emitted from the preprocessor. + diff --git a/sv-parser-pp/testcases/undefineall.sv b/sv-parser-pp/testcases/undefineall.sv new file mode 100644 index 0000000..734fb4a --- /dev/null +++ b/sv-parser-pp/testcases/undefineall.sv @@ -0,0 +1,45 @@ +// IEEE1800-2017 Clause 22.5.3 +// The directive `undefineall directive shall undefine all text macros +// previously defined by `define compiler directives within the compilation +// unit. This directive takes no argument and may appear anywhere in the source +// description. +`undefineall +`undefineall// Comment +`undefineall // Comment + +`define FOO foo +`define BAR bar +`ifdef FOO +// AAA +// This block SHOULD be emitted from the preprocessor. +`endif +`ifndef FOO +// AAA +// This block should NOT be emitted from the preprocessor. +`endif +`ifdef BAR +// BBB +// This block SHOULD be emitted from the preprocessor. +`endif +`ifndef BAR +// BBB +// This block should NOT be emitted from the preprocessor. +`endif + +`undefineall +`ifdef FOO +// CCC +// This block should NOT be emitted from the preprocessor. +`endif +`ifndef FOO +// CCC +// This block SHOULD be emitted from the preprocessor. +`endif +`ifdef BAR +// DDD +// This block should NOT be emitted from the preprocessor. +`endif +`ifndef BAR +// DDD +// This block SHOULD be emitted from the preprocessor. +`endif