Skip to content

Commit fd3128a

Browse files
committed
tests: arch: arm_thread_swap: increase stack for no_optimizations
Under CONFIG_NO_OPTIMIZATIONS=y (-O0), the stack consumption for the test threads in arm_thread_swap exceeds the default 1024-byte allocation due to larger stack frames in unoptimized core kernel paths (such as k_thread_priority_set, verify_callee_saved, and reschedule chains). Because alt_thread_stack and user_thread_stack are sized with 1024 + CONFIG_TEST_EXTRA_STACK_SIZE, adjusting CONFIG_MAIN_STACK_SIZE alone does not allocate extra space for these test threads. Add CONFIG_TEST_EXTRA_STACK_SIZE=1024 to extra_configs in both arch.arm.swap.common.no_optimizations and arch.arm.swap.common.fpu_sharing.no_optimizations test scenarios to provide sufficient stack budget under -O0. Fixes #111477 Signed-off-by: harshit kudhial <harshitkudhial@gmail.com>
1 parent e64f6be commit fd3128a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tests/arch/arm/arm_thread_swap/tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tests:
1515
- CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n
1616
- CONFIG_IDLE_STACK_SIZE=512
1717
- CONFIG_MAIN_STACK_SIZE=2048
18+
- CONFIG_TEST_EXTRA_STACK_SIZE=1024
1819
min_flash: 192
1920
arch.arm.swap.common.fpu_sharing:
2021
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_ARMV7_M_ARMV8_M_FP
@@ -30,4 +31,5 @@ tests:
3031
- CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n
3132
- CONFIG_IDLE_STACK_SIZE=512
3233
- CONFIG_MAIN_STACK_SIZE=2048
34+
- CONFIG_TEST_EXTRA_STACK_SIZE=1024
3335
min_flash: 192

0 commit comments

Comments
 (0)