Skip to content

Commit 177f63f

Browse files
strengthen the test and correct minor errors
1 parent 2557de3 commit 177f63f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

libc/src/__support/HashTable/generic/bitmask_impl.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/HashTable/bitmask.h"
109
#include "src/__support/common.h"
1110
#include "src/__support/endian.h"
1211

@@ -52,7 +51,7 @@ struct Group {
5251
return {data.value};
5352
}
5453

55-
// Load a group of control words from an arbitary address.
54+
// Load a group of control words from an aligned address.
5655
LIBC_INLINE static Group load_aligned(const void *__restrict addr) {
5756
return *static_cast<const Group *>(addr);
5857
}

libc/src/__support/HashTable/sse2/bitmask_impl.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct Group {
2323
return {_mm_loadu_si128(static_cast<const __m128i *>(addr))};
2424
}
2525

26-
// Load a group of control words from an arbitary address.
26+
// Load a group of control words from an aligned address.
2727
LIBC_INLINE static Group load_aligned(const void *__restrict addr) {
2828
return {_mm_load_si128(static_cast<const __m128i *>(addr))};
2929
}

libc/test/src/search/hsearch_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ TEST(LlvmLibcHSearchTest, GrowFromZero) {
6060
ASSERT_NE(inserted, static_cast<ENTRY *>(nullptr));
6161
ASSERT_EQ(inserted->key, &search_data[i]);
6262
}
63+
for (size_t i = sizeof(search_data) - 1; i != 0; --i) {
64+
ASSERT_EQ(
65+
LIBC_NAMESPACE::hsearch({&search_data[i - 1], nullptr}, FIND)->data,
66+
reinterpret_cast<void *>(i - 1));
67+
}
6368

6469
LIBC_NAMESPACE::hdestroy();
6570
}

0 commit comments

Comments
 (0)