Skip to content

Commit ded31d0

Browse files
committed
Verilog: extend test for unary minus and Boolean negation
This extends two tests to check that a) the downwards expression context passes through unary minus. b) the downwards expression context does not pass through Boolean negation.
1 parent 445ac04 commit ded31d0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

regression/verilog/expressions/negation1.sv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ module main;
88
property06: assert final (!2'bxx===1'bx);
99
property07: assert final (!1'bz===1'bx);
1010

11+
// expression type contexts do not pass through !
12+
initial assert(!(1'b1 + 1'b1) == 1);
13+
1114
endmodule

regression/verilog/expressions/unary_minus1.sv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ module main;
33
// Any arithmetic with x or z returns x.
44
initial assert(-32'bz === 32'hxxxx_xxxx);
55

6+
// Downwards type propagation passes through unary minus.
7+
initial assert(-(1'sb1 + 1'sb1) == 2);
8+
69
endmodule

0 commit comments

Comments
 (0)