[PATCH 03/13] sptls02: Fix alignment check

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Sep 30 09:21:26 UTC 2022


---
 testsuites/sptests/sptls02/init.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/testsuites/sptests/sptls02/init.cc b/testsuites/sptests/sptls02/init.cc
index e4791cffd6..39fc2a2a24 100644
--- a/testsuites/sptests/sptls02/init.cc
+++ b/testsuites/sptests/sptls02/init.cc
@@ -169,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);
+	addr = reinterpret_cast<uintptr_t>(&a512);
+	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);
-- 
2.35.3



More information about the devel mailing list