Skip to content

Commit 7cb6e6b

Browse files
committed
[libc] Fix sort test failing on NVPTX
Summary: This test uses too much stack and crashes, make the buffer `static` to push it to `.bss`. This shouldn't change behavior because the tests are all run single threaded.
1 parent 05bd7d2 commit 7cb6e6b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libc/test/src/stdlib/SortingTest.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,9 @@ class SortingTest : public LIBC_NAMESPACE::testing::Test {
298298
static_assert(ARRAY_LEN < 256); // so we can encode the values.
299299

300300
// Minimum alignment to test implementation for bugs related to assuming
301-
// incorrect association between alignment and element size.
302-
alignas(1) uint8_t buf[BUF_SIZE];
301+
// incorrect association between alignment and element size. The buffer is
302+
// 'static' as otherwise it will exhaust the stack on the GPU targets.
303+
alignas(1) static uint8_t buf[BUF_SIZE];
303304

304305
// GCC still requires capturing the constant ARRAY_INITIAL_VALS in the
305306
// lambda hence, let's use & to implicitly capture all needed variables

0 commit comments

Comments
 (0)