won't affect the test adversely -- so let's do this and get rid of
the special compilation again. Also guard against future compiler smartness
tricking the compiler into believing the variable is actually used.
So the loop won't get optimised away.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14094
# because then we can't intercept it
overlap_CFLAGS = $(AM_CFLAGS) -fno-builtin-memcpy -fno-builtin-strcpy
-pdb_realloc_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@
-
str_tester_CFLAGS = $(AM_CFLAGS) -Wno-shadow
supp_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@
int main(void)
{
- int i, t;
+ int i, t = 0;
char* x = malloc(1000);
// Write some PDBs (partially defined bytes)
for (i = 0; i < 1000; i++)
t += x[i];
+ __asm__ __volatile__ ("" :: "r"(t));
+
return 0;
}