@@ -408,6 +408,9 @@ Compiler directives should not cause whitespace issues or hide in other code.
408408`resetall
409409/* This FILE is `__FILE__ */
410410/* This LINE is `__LINE__ */
411+ // This directive is commented `celldefine
412+ module testmodule(); //Those directives are also commented `ifdef FOO Foo `else Bar `endif
413+ endmodule
411414`include "testcases/syntaxrules/pass/blocking_assignment_in_always_ff.sv"
412415`define FOO 5
413416`ifdef FOO
@@ -418,17 +421,18 @@ Compiler directives should not cause whitespace issues or hide in other code.
418421`endif
419422`undef FOO
420423`undefineall
421-
424+ `ifdef FOO // `ifdef BAR
425+ `endif
422426```
423427
424- ### Fail Example (1 of 3 )
428+ ### Fail Example (1 of 4 )
425429``` systemverilog
426430module `ifdef FOO Foo `else Bar `endif
427431 (); // ifdef, else, and endif are on a single line.
428432endmodule
429433```
430434
431- ### Fail Example (2 of 3 )
435+ ### Fail Example (2 of 4 )
432436``` systemverilog
433437`ifdef FOO
434438 `ifdef BAR
@@ -439,7 +443,7 @@ endmodule
439443`endif
440444```
441445
442- ### Fail Example (3 of 3 )
446+ ### Fail Example (3 of 4 )
443447``` systemverilog
444448module M ();
445449 always_comb
@@ -455,6 +459,12 @@ module M ();
455459endmodule
456460```
457461
462+ ### Fail Example (4 of 4)
463+ ``` systemverilog
464+ `ifdef FOO // The ifdef is not commented and indented
465+ `endif
466+ ```
467+
458468### Explanation
459469
460470Check that (most) preprocessor and compiler directives are not indented, and
0 commit comments