blob: 7e65727926ff5a64e2c8b64e9beaea1a4f26c3d6 [file] [log] [blame]
/*
:name: associative-arrays-first
:description: Test support of associative arrays methods (first)
:should_fail: 0
:tags: 7.9.4 7.9
*/
module top ();
int map [ string ];
string s;
int rc;
initial begin
// empty, should return zero
rc = map.first( s );
$display(":assert: (%d == 0)", rc);
map[ "hello" ] = 1;
map[ "sad" ] = 2;
map[ "world" ] = 3;
rc = map.first( s );
$display(":assert: ((%d == 1) and ('%s' == 'hello'))", rc, s);
end
endmodule