data/full_repos/permissive/143278/ivltests/function3.11F.v
data/verilator_xmls/d8bc52f2-2580-45c6-89be-e8630feb0e51.xml
module main ();

reg [1:0] val1;
reg	  val2;
reg	  error;

function bar;
    input [1:0] arg;
    reg result;
    begin
      result = |arg;
      bar = result;
    end
endfunction

initial
  begin
    error = 0;
    val2  = bar(2'b01);
    if(val2 != 1)
      begin
        $display("FAILED function 3.11F - register within a function(1)");
        error = 1;
      end
    val1 = 2'b11 ;
    val2 = bar(val1) ;
    if(val2 != 1)
      begin
        $display("FAILED function 3.11F - register within a function(2)");
        error = 1;
      end
    val2 = bar(2'b00);
    if(val2 != 0)
      begin
        $display("FAILED function 3.11F - register within a function(2)");
        error = 1;
      end
    if(error == 0)
      $display("PASSED");
  end

endmodule
module main ();


reg [1:0] val1;
reg	  val2;
reg	  error;

function bar;
    input [1:0] arg;
    reg result;
    begin
      result = |arg;
      bar = result;
    end
endfunction

initial
  begin
    error = 0;
    val2  = bar(2'b01);
    if(val2 != 1)
      begin
        $display("FAILED function 3.11F - register within a function(1)");
        error = 1;
      end
    val1 = 2'b11 ;
    val2 = bar(val1) ;
    if(val2 != 1)
      begin
        $display("FAILED function 3.11F - register within a function(2)");
        error = 1;
      end
    val2 = bar(2'b00);
    if(val2 != 0)
      begin
        $display("FAILED function 3.11F - register within a function(2)");
        error = 1;
      end
    if(error == 0)
      $display("PASSED");
  end

endmodule