ppTests undefineall

This commit is contained in:
damc 2022-07-26 13:06:16 +02:00
parent ae43678b9e
commit 543915011b
2 changed files with 74 additions and 0 deletions

View File

@ -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.

View File

@ -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