Skip to content

Commit b0629eb

Browse files
authored
Merge pull request #1352 from diffblue/unary_minus1-ext
Verilog: extend test for unary minus and Boolean negation
2 parents 389474c + ded31d0 commit b0629eb

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)