mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-28 16:53:45 +02:00
By adding ivtest to the iverilog source tree, it is easier to keep the regression test synchronized with the source that is being tested. This should be especially helpful for PRs that add a new feature, and have a matching ivtest PR with the regression test for that feature.
33 lines
628 B
Verilog
33 lines
628 B
Verilog
// Ensure the compiler doesn't perform some invalid optimisations.
|
|
|
|
module test();
|
|
|
|
reg [3:0] unknown;
|
|
reg [3:0] result;
|
|
|
|
reg failed;
|
|
|
|
initial begin
|
|
failed = 0;
|
|
unknown = 4'bx101;
|
|
result = unknown + 0;
|
|
$display("%b", result);
|
|
if (result !== 4'bxxxx) failed = 1;
|
|
result = (unknown >> 1) + 0;
|
|
$display("%b", result);
|
|
if (result !== 4'bxxxx) failed = 1;
|
|
result = unknown - 0;
|
|
$display("%b", result);
|
|
if (result !== 4'bxxxx) failed = 1;
|
|
result = unknown * 0;
|
|
$display("%b", result);
|
|
if (result !== 4'bxxxx) failed = 1;
|
|
|
|
if (failed)
|
|
$display("FAILED");
|
|
else
|
|
$display("PASSED");
|
|
end
|
|
|
|
endmodule
|