From: Julian Seward Date: Thu, 19 Jan 2006 03:52:19 +0000 (+0000) Subject: Clever handling of partially defined equality does not work on X-Git-Tag: svn/VALGRIND_3_2_0~353 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaacb37226b8e45ad262b6a3918f87f3e33d8f94;p=thirdparty%2Fvalgrind.git Clever handling of partially defined equality does not work on ppc32/64 at the moment. Make this test handle that whilst still testing the facility on x86/amd64. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5558 --- diff --git a/memcheck/tests/partiallydefinedeq.c b/memcheck/tests/partiallydefinedeq.c index 6d7696f012..871e69303b 100644 --- a/memcheck/tests/partiallydefinedeq.c +++ b/memcheck/tests/partiallydefinedeq.c @@ -18,7 +18,7 @@ void foo ( int* p1, int* p2, unsigned int * hack ) printf("bar\n"); } - +static void bar ( void ); int main ( void ) { @@ -32,7 +32,7 @@ int main ( void ) int* pi1 = (int*)junk1; int* pi2 = (int*)junk2; - + bar(); // both words completely undefined. This should give an error. foo(pi1,pi2, &hack); @@ -53,3 +53,13 @@ int main ( void ) return 0; } + +// Note: on ppc32/64 the second call to foo() does give an error, +// since the expensive EQ/NE scheme does not apply to the CmpORD +// primops used by ppc. +static void bar ( void ) +{ +#if defined(__powerpc__) || defined(__powerpc64__) + fprintf(stderr, "Currently running on ppc32/64: this test should give 3 errors, not 2.\n"); +#endif +} diff --git a/memcheck/tests/partiallydefinedeq.stderr.exp2 b/memcheck/tests/partiallydefinedeq.stderr.exp2 new file mode 100644 index 0000000000..78ab70bb30 --- /dev/null +++ b/memcheck/tests/partiallydefinedeq.stderr.exp2 @@ -0,0 +1,19 @@ + +Currently running on ppc32/64: this test should give 3 errors, not 2. +Conditional jump or move depends on uninitialised value(s) + at 0x........: foo (partiallydefinedeq.c:15) + by 0x........: main (partiallydefinedeq.c:37) + +Conditional jump or move depends on uninitialised value(s) + at 0x........: foo (partiallydefinedeq.c:15) + by 0x........: main (partiallydefinedeq.c:45) + +Conditional jump or move depends on uninitialised value(s) + at 0x........: foo (partiallydefinedeq.c:15) + by 0x........: main (partiallydefinedeq.c:52) + +ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0) +malloc/free: in use at exit: 8 bytes in 2 blocks. +malloc/free: 2 allocs, 0 frees, 8 bytes allocated. +For a detailed leak analysis, rerun with: --leak-check=yes +For counts of detected errors, rerun with: -v