Nicholas Nethercote db419f2bdc Moved discard, clientperm and clientstackperm from tests/ into the test
suite-proper, giving them .vgtest files and all that.  They don't make sense
for 1.0.X because the client request constants are different in HEAD, indeed
one of them (clientperm) fails with --stable.

Also moved blocked_syscall.c from tests/ to tests/unused/.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1181
2002-10-04 14:16:38 +00:00

40 lines
739 B
C

#include <stdio.h>
#include <stdlib.h>
#include "../memcheck.h"
int main1 ( void )
{
int xxx, i;
for (i = 0; i < 10; i++) VALGRIND_CHECK_DEFINED(xxx);
return 0;
}
int main ( void )
{
int i, sum, m;
char* aa = calloc(100,1);
sum = 0;
VALGRIND_CHECK_READABLE(aa,100);
m = VALGRIND_MAKE_WRITABLE( &aa[49], 1 );
VALGRIND_CHECK_WRITABLE(aa,100);
printf("m_na: returned value is %d\n", m );
for (i = 0; i < 100; i++)
sum += aa[i];
printf("sum is %s\n", sum > 0 ? "positive" : "non-positive");
m = VALGRIND_DISCARD(m);
printf("m_rm: returned value is %d\n", m );
for (i = 0; i < 100; i++)
sum += aa[i];
printf("sum is %s\n", sum > 0 ? "positive" : "non-positive");
return 0;
}