ppTests undefineall
This commit is contained in:
parent
ae43678b9e
commit
543915011b
29
sv-parser-pp/testcases/expected/undefineall.sv
Normal file
29
sv-parser-pp/testcases/expected/undefineall.sv
Normal 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.
|
||||||
|
|
45
sv-parser-pp/testcases/undefineall.sv
Normal file
45
sv-parser-pp/testcases/undefineall.sv
Normal 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
|
Loading…
x
Reference in New Issue
Block a user