esp-idf/components/esp32c3/test/test_stack_check.c
Angus Gratton 544c5e57ce esp32c3: Add tests for esp_sha, stack checker
From internal commit 6d894813
2020-12-24 14:18:01 +11:00

26 lines
399 B
C

#include "unity.h"
#if CONFIG_COMPILER_STACK_CHECK
static void recur_and_smash(void)
{
static int cnt;
volatile uint8_t buf[50];
volatile int num = sizeof(buf)+10;
if (cnt++ < 1) {
recur_and_smash();
}
for (int i = 0; i < num; i++) {
buf[i] = 0;
}
}
TEST_CASE("stack smashing protection", "[stack_check] [ignore]")
{
recur_and_smash();
}
#endif