data/full_repos/permissive/143278/ivltests/pr3098439a.v
1: b'%Warning-WIDTH: data/full_repos/permissive/143278/ivltests/pr3098439a.v:42: Operator NEGATE expects 32 bits on the LHS, but LHS\'s CONST \'1\'sh1\' generates 1 bits.\n                                                                          : ... In instance test\n    $sformat(str, "%0d", ((s << 64) + 1\'sd1) * -1\'sd1);\n                                               ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: Exiting due to 1 warning(s)\n'
module test;
  reg pass;
  reg [8*40:1] str;
  integer s;

  initial begin
    pass = 1'b1;
    s = 1;

    $sformat(str, "%0d", ((0 << 1) + 1) * -1);
    if (str[8*2:1] !== "-1" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 1st test, expected \"-1\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((1 << 1) + 1) * -1);
    if (str[8*2:1] !== "-3" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 2nd test, expected \"-3\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((1 << s) + 1) * -1);
    if (str[8*2:1] !== "-3" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 3rd test, expected \"-3\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((s << 1) + 1) * -1);
    if (str[8*2:1] !== "-3" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 4th test, expected \"-3\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((s << 0) + 1) * -1);
    if (str[8*2:1] !== "-2" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 5th test, expected \"-2\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((s << 64) + 1'sd1) * -1'sd1);
    if (str[8*2:1] !== "-1" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 6th test, expected \"-1\", got %s", str);
      pass = 1'b0;
    end

    if (pass) $display("PASSED");
  end
endmodule
module test;

  reg pass;
  reg [8*40:1] str;
  integer s;

  initial begin
    pass = 1'b1;
    s = 1;

    $sformat(str, "%0d", ((0 << 1) + 1) * -1);
    if (str[8*2:1] !== "-1" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 1st test, expected \"-1\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((1 << 1) + 1) * -1);
    if (str[8*2:1] !== "-3" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 2nd test, expected \"-3\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((1 << s) + 1) * -1);
    if (str[8*2:1] !== "-3" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 3rd test, expected \"-3\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((s << 1) + 1) * -1);
    if (str[8*2:1] !== "-3" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 4th test, expected \"-3\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((s << 0) + 1) * -1);
    if (str[8*2:1] !== "-2" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 5th test, expected \"-2\", got %s", str);
      pass = 1'b0;
    end

    $sformat(str, "%0d", ((s << 64) + 1'sd1) * -1'sd1);
    if (str[8*2:1] !== "-1" || str[8*40:8*2+1] !== 0) begin
      $display("FAILED 6th test, expected \"-1\", got %s", str);
      pass = 1'b0;
    end

    if (pass) $display("PASSED");
  end
endmodule