diff --git a/tests/lib/cpp/libcxx/prj.conf b/tests/lib/cpp/libcxx/prj.conf index 043fb1391b3708d..fff9acb3adca156 100644 --- a/tests/lib/cpp/libcxx/prj.conf +++ b/tests/lib/cpp/libcxx/prj.conf @@ -2,4 +2,5 @@ CONFIG_CPP=y CONFIG_STD_CPP17=y CONFIG_ZTEST=y CONFIG_ZTEST_STACK_SIZE=5120 +CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=32768 CONFIG_ZTEST_NEW_API=y diff --git a/tests/lib/cpp/libcxx/src/main.cpp b/tests/lib/cpp/libcxx/src/main.cpp index 3151aaae892d0f7..d1d7d37af188403 100644 --- a/tests/lib/cpp/libcxx/src/main.cpp +++ b/tests/lib/cpp/libcxx/src/main.cpp @@ -9,6 +9,7 @@ #include #include #include +#include BUILD_ASSERT(__cplusplus == 201703); @@ -95,6 +96,17 @@ ZTEST(libcxx_tests, test_exception) } #endif +struct ThreadStack +{ + K_KERNEL_STACK_MEMBER(threadStack, 1024) {}; +}; + +ZTEST(libcxx_tests, test_new_aligned) +{ + auto test_aligned = std::make_unique(); + zassert_not_null(test_aligned, "aligned allocation failed"); +} + static void *libcxx_tests_setup(void) { TC_PRINT("version %u\n", (uint32_t)__cplusplus);