[rtems commit] spcxx01: Add test case

Sebastian Huber sebh at rtems.org
Fri Dec 21 12:32:26 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Dec 21 13:31:32 2018 +0100

spcxx01: Add test case

---

 testsuites/sptests/spcxx01/init.cc | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/testsuites/sptests/spcxx01/init.cc b/testsuites/sptests/spcxx01/init.cc
index 9867316..7962810 100644
--- a/testsuites/sptests/spcxx01/init.cc
+++ b/testsuites/sptests/spcxx01/init.cc
@@ -37,6 +37,10 @@
 
 const char rtems_test_name[] = "SPCXX 1";
 
+struct alignas(256) S {
+  int i;
+};
+
 extern "C" void Init(rtems_task_argument arg)
 {
   TEST_BEGIN();
@@ -49,6 +53,12 @@ extern "C" void Init(rtems_task_argument arg)
   rtems_test_assert(reinterpret_cast<uintptr_t>(i) % 256 == 0);
   ::delete(i);
 
+  S *s = new S;
+  RTEMS_OBFUSCATE_VARIABLE(s);
+  rtems_test_assert(s != nullptr);
+  rtems_test_assert(reinterpret_cast<uintptr_t>(s) % 256 == 0);
+  delete s;
+
   TEST_END();
   exit(0);
 }




More information about the vc mailing list