summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sptls02/init.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testsuites/sptests/sptls02/init.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/testsuites/sptests/sptls02/init.cc b/testsuites/sptests/sptls02/init.cc
index 712358f978..28ce872d76 100644
--- a/testsuites/sptests/sptls02/init.cc
+++ b/testsuites/sptests/sptls02/init.cc
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (C) 2014, 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2014, 2020 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -36,6 +36,7 @@
#include <rtems.h>
#include <rtems/libcsupport.h>
+#include <rtems/stackchk.h>
#include <tmacros.h>
@@ -47,7 +48,7 @@ alignas(256) static thread_local long a256 = 256;
static thread_local long i0;
-alignas(512) static thread_local long a512;
+alignas(RTEMS_MINIMUM_STACK_SIZE) static thread_local long a;
int seven()
{
@@ -60,7 +61,7 @@ static void clobber()
i123 = 0xdead0001;
a256 = 0xdead0002;
i0 = 0xdead0003;
- a512 = 0xdead0004;
+ a = 0xdead0004;
}
static long f456(bool clobber)
@@ -168,10 +169,14 @@ static void checkTLSValues()
rtems_test_assert(extern_int == 7);
rtems_test_assert(i123 == 123);
rtems_test_assert(a256 == 256);
- rtems_test_assert((a256 & 255) == 0);
+ uintptr_t addr = reinterpret_cast<uintptr_t>(&a256);
+ RTEMS_OBFUSCATE_VARIABLE(addr);
+ rtems_test_assert((addr % 256) == 0);
rtems_test_assert(i0 == 0);
- rtems_test_assert(a512 == 0);
- rtems_test_assert((a512 & 511) == 0);
+ rtems_test_assert(a == 0);
+ addr = reinterpret_cast<uintptr_t>(&a);
+ RTEMS_OBFUSCATE_VARIABLE(addr);
+ rtems_test_assert((addr % 512) == 0);
rtems_test_assert(f456(false) == 456);
rtems_test_assert(f0(false) == 0);
rtems_test_assert(C::c789() == 789);
@@ -288,6 +293,7 @@ extern "C" void Init(rtems_task_argument arg)
testWorkerTask();
rtems_test_assert(rtems_resource_snapshot_check(&snapshot));
+ rtems_test_assert(!rtems_stack_checker_is_blown());
TEST_END();
@@ -297,6 +303,8 @@ extern "C" void Init(rtems_task_argument arg)
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
+#define CONFIGURE_STACK_CHECKER_ENABLED
+
#define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_SEMAPHORES 3