[PATCH] D88824: [Support][unittests] Enforce alignment in ConvertUTFTest

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 01:36:57 PDT 2020


ro added a comment.

In D88824#2317728 <https://reviews.llvm.org/D88824#2317728>, @thakis wrote:

> This breaks tests on Windows: http://45.33.8.238/win/25377/step_11.txt
>
> PTAL, and if it takes a while to fix please revert while you investigate.

Sorry about that.  I see what's going on: `ConvertUTFTest.UTF16WrappersForConvertUTF16ToUTF8String` fails like the two others and could be fixed similarly by setting the alignment in the caller.  The two other callers of `convertUTF16ToUTF8String` in `ConvertUTFTest.cpp` (`OddLengthInput` and `Empty`) cannot be affected because the size and empty checks return before the `assert`.

However, all this is incredibly fragile: `ConvertUTFTest.ConvertUTF16LittleEndianToUTF8String` only `FAIL`ed for me in `Release` builds while `ConvertUTFTest.ConvertUTF16BigEndianToUTF8String` does in `Debug` builds.  The `assert` cannot distinguish if `SrcBytes` is properly aligned by construction of just by accident.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88824/new/

https://reviews.llvm.org/D88824



More information about the llvm-commits mailing list