[rtems commit] libtests/sha: Fix test if -O0 is used

Sebastian Huber sebh at rtems.org
Wed Sep 30 11:02:05 UTC 2020


Module:    rtems
Branch:    master
Commit:    2da7e94fe53caaf6d04c284da6c6c0fc71fa113a
Changeset: http://git.rtems.org/rtems/commit/?id=2da7e94fe53caaf6d04c284da6c6c0fc71fa113a

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Sep 30 12:53:33 2020 +0200

libtests/sha: Fix test if -O0 is used

---

 testsuites/libtests/sha/init.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/testsuites/libtests/sha/init.c b/testsuites/libtests/sha/init.c
index 78e09a7..64d2d34 100644
--- a/testsuites/libtests/sha/init.c
+++ b/testsuites/libtests/sha/init.c
@@ -23,6 +23,8 @@
 
 #include "tmacros.h"
 
+#include <rtems/stackchk.h>
+
 const char rtems_test_name[] = "SHA";
 
 static const char *const test_vectors[] = {
@@ -170,6 +172,7 @@ static void Init(rtems_task_argument arg)
 
   test_sha256();
   test_sha512();
+  rtems_stack_checker_report_usage();
 
   TEST_END();
   rtems_test_exit(0);
@@ -180,10 +183,18 @@ static void Init(rtems_task_argument arg)
 
 #define CONFIGURE_MAXIMUM_TASKS 1
 
+#define CONFIGURE_STACK_CHECKER_ENABLED
+
 #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
+/*
+ * The SHA512_Update() function may need a lot of stack space if the compiler
+ * optimization is disabled.
+ */
+#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024)
+
 #define CONFIGURE_INIT
 
 #include <rtems/confdefs.h>



More information about the vc mailing list