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

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 13:28:19 PDT 2020


ro marked an inline comment as done.
ro added inline comments.


================
Comment at: llvm/unittests/Support/ConvertUTFTest.cpp:19
   // Src is the look of disapproval.
-  static const char Src[] = "\xff\xfe\xa0\x0c_\x00\xa0\x0c";
+  static const char Src[] __attribute__((aligned(sizeof(UTF16)))) =
+      "\xff\xfe\xa0\x0c_\x00\xa0\x0c";
----------------
rnk wrote:
> MSVC doesn't support `__attribute__`, use `alignas(UTF16)` instead. It should be in use elsewhere in the codebase.
Nice, that's way more readable than the `__attribute__` syntax.


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