verilator/test_regress/t/t_func_void_bad.v

35 lines
630 B
Systemverilog
Raw Normal View History

2019-03-10 19:57:01 +01:00
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2003 Wilson Snyder
// SPDX-License-Identifier: CC0-1.0
2019-03-10 19:57:01 +01:00
2024-09-08 21:09:44 +02:00
class Cls;
2026-03-08 23:26:40 +01:00
function int fi();
return 10;
endfunction
static function int sfi();
return 10;
endfunction
2024-09-08 21:09:44 +02:00
endclass
2019-03-10 19:57:01 +01:00
2024-09-08 21:09:44 +02:00
module t;
2026-03-08 23:26:40 +01:00
function int f1;
return 20;
endfunction
2019-03-10 19:57:01 +01:00
2026-03-08 23:26:40 +01:00
initial begin
Cls c;
//
f1(); // Bad - ignored result
//
c = new;
c.fi(); // Bad - ignored result
c.sfi(); // Bad - ignored result
//
$write("*-* All Finished *-*\n");
$finish;
end
2019-03-10 19:57:01 +01:00
endmodule