[libc-commits] [PATCH] D149863: [libc] Maintain proper alignment for the hermetic tests malloc
Joseph Huber via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu May 4 09:57:31 PDT 2023
jhuber6 updated this revision to Diff 519546.
jhuber6 added a comment.
Changing magic number
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149863/new/
https://reviews.llvm.org/D149863
Files:
libc/test/UnitTest/HermeticTestUtils.cpp
libc/test/src/__support/CMakeLists.txt
Index: libc/test/src/__support/CMakeLists.txt
===================================================================
--- libc/test/src/__support/CMakeLists.txt
+++ libc/test/src/__support/CMakeLists.txt
@@ -1,17 +1,14 @@
add_custom_target(libc-support-tests)
-# This test fails with a misaigned address on NVPTX.
-if(NOT LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX)
- add_libc_test(
- blockstore_test
- SUITE
- libc-support-tests
- SRCS
- blockstore_test.cpp
- DEPENDS
- libc.src.__support.blockstore
- )
-endif()
+add_libc_test(
+ blockstore_test
+ SUITE
+ libc-support-tests
+ SRCS
+ blockstore_test.cpp
+ DEPENDS
+ libc.src.__support.blockstore
+)
add_libc_test(
endian_test
Index: libc/test/UnitTest/HermeticTestUtils.cpp
===================================================================
--- libc/test/UnitTest/HermeticTestUtils.cpp
+++ libc/test/UnitTest/HermeticTestUtils.cpp
@@ -62,6 +62,8 @@
int atexit(void (*func)(void)) { return __llvm_libc::atexit(func); }
void *malloc(size_t s) {
+ // Keep the bump pointer aligned on an eight byte boundary.
+ s = ((s + alignof(uintptr_t) - 1) / alignof(uintptr_t)) * alignof(uintptr_t);
void *mem = ptr;
ptr += s;
return mem;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149863.519546.patch
Type: text/x-patch
Size: 1234 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230504/77238133/attachment.bin>
More information about the libc-commits
mailing list