]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Clever handling of partially defined equality does not work on
authorJulian Seward <jseward@acm.org>
Thu, 19 Jan 2006 03:52:19 +0000 (03:52 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 19 Jan 2006 03:52:19 +0000 (03:52 +0000)
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

memcheck/tests/partiallydefinedeq.c
memcheck/tests/partiallydefinedeq.stderr.exp2 [new file with mode: 0644]

index 6d7696f012cb4d2d522f97ead84a6b5dcb7b1805..871e69303ba1ce5c389902eb20ef1c6af40c9362 100644 (file)
@@ -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 (file)
index 0000000..78ab70b
--- /dev/null
@@ -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