[rtems commit] fstests: Prevent compiler optimizations

Sebastian Huber sebh at rtems.org
Fri Feb 15 16:55:50 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Feb 15 18:00:19 2013 +0100

fstests: Prevent compiler optimizations

---

 testsuites/fstests/support/fstest_support.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/testsuites/fstests/support/fstest_support.c b/testsuites/fstests/support/fstest_support.c
index cbd8326..164ef7b 100644
--- a/testsuites/fstests/support/fstest_support.c
+++ b/testsuites/fstests/support/fstest_support.c
@@ -29,6 +29,8 @@
 #include "fstest.h"
 #include "pmacros.h"
 
+volatile void *prevent_compiler_optimizations;
+
 /* Break out of a chroot() environment in C */
 static void break_out_of_chroot(void)
 {
@@ -42,7 +44,8 @@ static void break_out_of_chroot(void)
   rtems_test_assert(rv == 0);
 
   /* Perform deferred memory frees */
-  free(malloc(1));
+  prevent_compiler_optimizations = malloc(1);
+  free(prevent_compiler_optimizations);
 }
 
 /*




More information about the vc mailing list