testsuites/sptests/spcache01/init.c: Address -Wclobbered warning

This warning indicates the potential for using a local variable which
is not guaranteed to be preserved across a setjmp()/longjmp() pair.

Updates #5364.
This commit is contained in:
Joel Sherrill
2026-01-23 17:38:39 -06:00
committed by Kinsey Moore
parent 63c93acec1
commit b8d245499e

View File

@@ -185,6 +185,15 @@ static uint64_t store(void)
return rtems_counter_ticks_to_nanoseconds(d);
}
static bool cache_invalidate_wrapper(void)
{
if (setjmp(instruction_invalidate_return_context) == 0) {
rtems_cache_invalidate_multiple_instruction_lines(do_some_work, 4096);
return false;
}
return true;
}
static void test_timing(void)
{
RTEMS_INTERRUPT_LOCK_DECLARE(, lock)
@@ -381,12 +390,7 @@ static void test_timing(void)
do_longjmp = true;
if (setjmp(instruction_invalidate_return_context) == 0) {
rtems_cache_invalidate_multiple_instruction_lines(do_some_work, 4096);
exception = false;
} else {
exception = true;
}
exception = cache_invalidate_wrapper();
do_longjmp = false;