mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-28 16:53:45 +02:00
Check that out-of-bounds access on a dynamic array or queue works and returns the correct value. * 2-state vectors: '0 with the element width * 4-state vectors: 'x with the element width * reals: 0.0 * strings: "" Note that the 2-state test currently still fails as out-of-bounds access on a 2-state vector incorrectly returns 'x. Signed-off-by: Lars-Peter Clausen <[email protected]>
19 lines
322 B
Verilog
19 lines
322 B
Verilog
// Check that out-of-bounds access on a string typed dynamic array works and
|
|
// returns the right value.
|
|
|
|
module test;
|
|
|
|
string d[];
|
|
string x;
|
|
|
|
initial begin
|
|
x = d[1];
|
|
if (x == "") begin
|
|
$display("PASSED");
|
|
end else begin
|
|
$display("FAILED. Expected '', got '%s'", x);
|
|
end
|
|
end
|
|
|
|
endmodule
|