Skip to content

Commit a4961f0

Browse files
committed
Revert "[Support][unittests] Enforce alignment in ConvertUTFTest"
This reverts commit 53b3873. Seems to break SupportTests.exe's ConvertUTFTest.UTF16WrappersForConvertUTF16ToUTF8String on Windows.
1 parent 3161172 commit a4961f0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

llvm/lib/Support/ConvertUTFWrapper.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out) {
9797
const UTF16 *Src = reinterpret_cast<const UTF16 *>(SrcBytes.begin());
9898
const UTF16 *SrcEnd = reinterpret_cast<const UTF16 *>(SrcBytes.end());
9999

100-
assert((uintptr_t)Src % sizeof(UTF16) == 0);
101-
102100
// Byteswap if necessary.
103101
std::vector<UTF16> ByteSwapped;
104102
if (Src[0] == UNI_UTF16_BYTE_ORDER_MARK_SWAPPED) {

llvm/unittests/Support/ConvertUTFTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using namespace llvm;
1616

1717
TEST(ConvertUTFTest, ConvertUTF16LittleEndianToUTF8String) {
1818
// Src is the look of disapproval.
19-
alignas(UTF16) static const char Src[] = "\xff\xfe\xa0\x0c_\x00\xa0\x0c";
19+
static const char Src[] = "\xff\xfe\xa0\x0c_\x00\xa0\x0c";
2020
ArrayRef<char> Ref(Src, sizeof(Src) - 1);
2121
std::string Result;
2222
bool Success = convertUTF16ToUTF8String(Ref, Result);
@@ -27,7 +27,7 @@ TEST(ConvertUTFTest, ConvertUTF16LittleEndianToUTF8String) {
2727

2828
TEST(ConvertUTFTest, ConvertUTF16BigEndianToUTF8String) {
2929
// Src is the look of disapproval.
30-
alignas(UTF16) static const char Src[] = "\xfe\xff\x0c\xa0\x00_\x0c\xa0";
30+
static const char Src[] = "\xfe\xff\x0c\xa0\x00_\x0c\xa0";
3131
ArrayRef<char> Ref(Src, sizeof(Src) - 1);
3232
std::string Result;
3333
bool Success = convertUTF16ToUTF8String(Ref, Result);

0 commit comments

Comments
 (0)