data/full_repos/permissive/143278/ivltests/pr1657307.v
 line:59: before: ":"
data/verilator_xmls/a41a4ec8-7017-4b9b-a8ba-087de406d3a1.xml
module test;
   integer dindex[2:0];
   integer cindex[2:0];

   initial
     main;

   task main;
      integer index;
      begin
	 dindex[0] = 3;
	 dindex[1] = 4;
	 dindex[2] = 5;

	 cindex[0] = 1;
	 cindex[1] = 2;
	 cindex[2] = 3;

	 index = get_index(3);
	 $write("index is %0d\n", index);
	 if (index !== 32)
	   $display("FAILED");
	 else
	   $display("PASSED");
      end
   endtask

   function integer get_index;
      input rank;
      integer rank;
      integer i, sum, multiplier;
      begin
	 multiplier = 1;
	 sum = 0;
	 for(i = rank-1; i >= 0; i = i-1) begin
	    sum = sum + (cindex[i] * multiplier);
	    multiplier = dindex[i] * multiplier;
	 end
	 get_index = sum-1;
      end
   endfunction

endmodule
module test;

   integer dindex[2:0];
   integer cindex[2:0];

   initial
     main;

   task main;
      integer index;
      begin
	 dindex[0] = 3;
	 dindex[1] = 4;
	 dindex[2] = 5;

	 cindex[0] = 1;
	 cindex[1] = 2;
	 cindex[2] = 3;

	 index = get_index(3);
	 $write("index is %0d\n", index);
	 if (index !== 32)
	   $display("FAILED");
	 else
	   $display("PASSED");
      end
   endtask

   function integer get_index;
      input rank;
      integer rank;
      integer i, sum, multiplier;
      begin
	 multiplier = 1;
	 sum = 0;
	 for(i = rank-1; i >= 0; i = i-1) begin
	    sum = sum + (cindex[i] * multiplier);
	    multiplier = dindex[i] * multiplier;
	 end
	 get_index = sum-1;
      end
   endfunction

endmodule