summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/libtests')
-rw-r--r--testsuites/libtests/malloc04/init.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/testsuites/libtests/malloc04/init.c b/testsuites/libtests/malloc04/init.c
index 89cbab327f..c1fc2367e1 100644
--- a/testsuites/libtests/malloc04/init.c
+++ b/testsuites/libtests/malloc04/init.c
@@ -41,7 +41,12 @@ void *rtems_heap_null_extend(
#endif
char Malloc_Heap[ 256 ] CPU_STRUCTURE_ALIGNMENT;
-int sbrk_count;
+
+/*
+ * Use volatile to prevent compiler optimizations due to the malloc() builtin.
+ */
+volatile int sbrk_count;
+
Heap_Control TempHeap;
size_t offset;