<html>
  <head>
    
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Once again: tests covering *missing* functionality are useless.<br>
    It's the same as adding tests to missing relocations and catching
    error output informing that relocations are missing.<br>
    <br>
    When and if someone adds logic to handle negative offsets for group
    relocations, they would add proper test cases.<br>
    For now on the linker will inform users that it can't perform
    handling of group relocations with negative offsets, which is
    perfectly enough for diagnostics.<br>
    <br>
    Thanks,<br>
      Denis.<br>
    <br>
    <div class="moz-cite-prefix">On 05/22/2015 10:10 AM, Filipe
      Cabecinhas wrote:<br>
    </div>
    <blockquote
cite="mid:CAEDE852mqvCDuKNgeXXSnHmiffj9jya=uuZHDO51irWmHdmJ+w@mail.gmail.com"
      type="cite">It's adding tests for actual functionality:
      <div>  If the offset is negative, error out with "blah".</div>
      <div><br>
      </div>
      <div>Regards,</div>
      <div><br>
      </div>
      <div>  Filipe<br>
        <br>
        On Thursday, May 21, 2015, Denis Protivensky <<a
          moz-do-not-send="true"
          href="mailto:dprotivensky@accesssoftek.com">dprotivensky@accesssoftek.com</a>>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF"> Yes, I know that. It's
            not error handling, but rather an indication of missing
            functionality.<br>
            I consider adding tests for not implemented functionality to
            be excessive.<br>
            <br>
            <div>On 05/22/2015 02:52 AM, Rafael Espíndola wrote:<br>
            </div>
            <blockquote type="cite">
              <p dir="ltr">It is good practice to include a test case
                when adding error handling. </p>
              <div class="gmail_quote">On May 7, 2015 9:48 AM, "Denis
                Protivensky" <<a moz-do-not-send="true"
                  href="javascript:_e(%7B%7D,'cvml','dprotivensky@accesssoftek.com');"
                  target="_blank">dprotivensky@accesssoftek.com</a>>
                wrote:<br type="attribution">
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">Author:


                  denis-protivensky<br>
                  Date: Thu May  7 08:41:44 2015<br>
                  New Revision: 236726<br>
                  <br>
                  URL: <a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D236726-26view-3Drev&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=iixKjXcsENgPMCwJibZbCizoIK42E3-Z0gcTZTBaXT0&s=Zh9HDU2dYjvwOEHpIujW76DGzDgMjWcF5EHWbbutZGc&e="
                    target="_blank">http://llvm.org/viewvc/llvm-project?rev=236726&view=rev</a><br>
                  Log:<br>
                  [ARM] llvm_unreachable => make_*_reloc_error in
                  group relocs<br>
                  <br>
                  Modified:<br>
                     
                  lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp<br>
                  <br>
                  Modified:
                  lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp<br>
                  URL: <a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_ELF_ARM_ARMRelocationHandler.cpp-3Frev-3D236726-26r1-3D236725-26r2-3D236726-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=iixKjXcsENgPMCwJibZbCizoIK42E3-Z0gcTZTBaXT0&s=Q4c3WV1ZryTA_gWgPsQ3tpIeDZpZAzpx4aCkNiL3Axc&e="
                    target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp?rev=236726&r1=236725&r2=236726&view=diff</a><br>
==============================================================================<br>
                  ---
                  lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp
                  (original)<br>
                  +++
                  lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp
                  Thu May  7 08:41:44 2015<br>
                  @@ -112,6 +112,11 @@ static Reference::Addend
                  readAddend(cons<br>
                     }<br>
                   }<br>
                  <br>
                  +static inline std::error_code
                  make_unsupported_range_group_reloc_error() {<br>
                  +  return make_dynamic_error_code(<br>
                  +      "Negative offsets for group relocations are not
                  implemented");<br>
                  +}<br>
                  +<br>
                   static inline std::error_code applyArmReloc(uint8_t
                  *location, uint32_t result,<br>
                                                               uint32_t
                  mask = 0xFFFFFFFF) {<br>
                     assert(!(result & ~mask));<br>
                  @@ -475,10 +480,8 @@ static std::error_code
                  relocR_ARM_ALU_PC<br>
                   static std::error_code
                  relocR_ARM_ALU_PC_G0_NC(uint8_t *location, uint64_t P,<br>
                                                                 
                  uint64_t S, int64_t A) {<br>
                     int32_t result = (int32_t)(S + A - P);<br>
                  -<br>
                     if (result < 0)<br>
                  -    llvm_unreachable(<br>
                  -        "Negative offsets for group relocations has
                  not been implemented");<br>
                  +    return
                  make_unsupported_range_group_reloc_error();<br>
                  <br>
                     DEBUG(llvm::dbgs() << "\t\tHandle " <<
                  LLVM_FUNCTION_NAME << " -";<br>
                           llvm::dbgs() << " S: 0x" <<
                  Twine::utohexstr(S);<br>
                  @@ -494,10 +497,8 @@ static std::error_code
                  relocR_ARM_ALU_PC<br>
                   static std::error_code
                  relocR_ARM_ALU_PC_G1_NC(uint8_t *location, uint64_t P,<br>
                                                                 
                  uint64_t S, int64_t A) {<br>
                     int32_t result = (int32_t)(S + A - P);<br>
                  -<br>
                     if (result < 0)<br>
                  -    llvm_unreachable(<br>
                  -        "Negative offsets for group relocations has
                  not been implemented");<br>
                  +    return
                  make_unsupported_range_group_reloc_error();<br>
                  <br>
                     DEBUG(llvm::dbgs() << "\t\tHandle " <<
                  LLVM_FUNCTION_NAME << " -";<br>
                           llvm::dbgs() << " S: 0x" <<
                  Twine::utohexstr(S);<br>
                  @@ -513,10 +514,8 @@ static std::error_code
                  relocR_ARM_ALU_PC<br>
                   static std::error_code relocR_ARM_LDR_PC_G2(uint8_t
                  *location, uint64_t P,<br>
                                                               uint64_t
                  S, int64_t A) {<br>
                     int32_t result = (int32_t)(S + A - P);<br>
                  -<br>
                     if (result < 0)<br>
                  -    llvm_unreachable(<br>
                  -        "Negative offsets for group relocations has
                  not been implemented");<br>
                  +    return
                  make_unsupported_range_group_reloc_error();<br>
                  <br>
                     DEBUG(llvm::dbgs() << "\t\tHandle " <<
                  LLVM_FUNCTION_NAME << " -";<br>
                           llvm::dbgs() << " S: 0x" <<
                  Twine::utohexstr(S);<br>
                  <br>
                  <br>
                  _______________________________________________<br>
                  llvm-commits mailing list<br>
                  <a moz-do-not-send="true"
                    href="javascript:_e(%7B%7D,'cvml','llvm-commits@cs.uiuc.edu');"
                    target="_blank">llvm-commits@cs.uiuc.edu</a><br>
                  <a moz-do-not-send="true"
                    href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits"
                    target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
                </blockquote>
              </div>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
      <br>
      <br>
      -- <br>
        F<br>
      <br>
    </blockquote>
    <br>
  </body>
</html>