verilator/test_regress/t/t_func_void_bad.v

35 lines
675 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, for
// any use, without warranty, 2003 by 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;
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;
2019-03-10 19:57:01 +01:00
function int f1;
2024-09-08 21:09:44 +02:00
return 20;
2019-03-10 19:57:01 +01:00
endfunction
initial begin
2024-09-08 21:09:44 +02:00
Cls c;
2019-03-10 19:57:01 +01:00
//
2024-09-08 21:09:44 +02:00
f1(); // Bad - ignored result
2019-03-10 19:57:01 +01:00
//
2024-09-08 21:09:44 +02:00
c = new;
c.fi(); // Bad - ignored result
c.sfi(); // Bad - ignored result
2019-03-10 19:57:01 +01:00
//
$write("*-* All Finished *-*\n");
$finish;
end
endmodule