|
From: <sv...@va...> - 2009-04-28 00:16:16
|
Author: njn
Date: 2009-04-28 01:15:51 +0100 (Tue, 28 Apr 2009)
New Revision: 9652
Log:
Make origin1-yes pass on Darwin.
Added:
branches/DARWIN/memcheck/tests/origin1-yes.stderr.exp-darwin
Modified:
branches/DARWIN/memcheck/tests/origin1-yes.c
branches/DARWIN/memcheck/tests/origin1-yes.stderr.exp
Modified: branches/DARWIN/memcheck/tests/origin1-yes.c
===================================================================
--- branches/DARWIN/memcheck/tests/origin1-yes.c 2009-04-27 22:50:26 UTC (rev 9651)
+++ branches/DARWIN/memcheck/tests/origin1-yes.c 2009-04-28 00:15:51 UTC (rev 9652)
@@ -86,12 +86,21 @@
}
// Heap segment (brk), uninitialised
+ // Nb: on Darwin, sbrk() is implemented via vm_allocate() which always
+ // zeroes its allocated memory. So we use a separate .exp file for Darwin,
+ // but we add an extra printf on Darwin only so that it cannot be
+ // successfully matched on non-Darwin platforms.
+#if defined(VGO_darwin)
+ fprintf(stderr, "\nUndef 7 of 8 (brk)\n");
+ fprintf(stderr, "\n(no complaint; sbrk initialises memory on Darwin)\n");
+#else
{
int* ptr_to_new_brk_limit = sbrk(4096);
int undef_brk_int = *ptr_to_new_brk_limit;
fprintf(stderr, "\nUndef 7 of 8 (brk)\n");
x += (undef_brk_int == 0x12345678 ? 15 : 26);
}
+#endif
// User block, marked as undefined
{
Modified: branches/DARWIN/memcheck/tests/origin1-yes.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/origin1-yes.stderr.exp 2009-04-27 22:50:26 UTC (rev 9651)
+++ branches/DARWIN/memcheck/tests/origin1-yes.stderr.exp 2009-04-28 00:15:51 UTC (rev 9652)
@@ -54,9 +54,9 @@
Undef 8 of 8 (MAKE_MEM_UNDEFINED)
Conditional jump or move depends on uninitialised value(s)
- at 0x........: main (origin1-yes.c:101)
+ at 0x........: main (origin1-yes.c:110)
Uninitialised value was created by a client request
- at 0x........: main (origin1-yes.c:99)
+ at 0x........: main (origin1-yes.c:108)
Def 1 of 3
Added: branches/DARWIN/memcheck/tests/origin1-yes.stderr.exp-darwin
===================================================================
--- branches/DARWIN/memcheck/tests/origin1-yes.stderr.exp-darwin (rev 0)
+++ branches/DARWIN/memcheck/tests/origin1-yes.stderr.exp-darwin 2009-04-28 00:15:51 UTC (rev 9652)
@@ -0,0 +1,60 @@
+
+Undef 1 of 8 (stack, 32 bit)
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: main (origin1-yes.c:37)
+ Uninitialised value was created by a stack allocation
+ at 0x........: main (origin1-yes.c:23)
+
+Undef 2 of 8 (stack, 32 bit)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: main (origin1-yes.c:49)
+ Uninitialised value was created by a stack allocation
+ at 0x........: main (origin1-yes.c:23)
+
+Undef 3 of 8 (stack, 64 bit)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: main (origin1-yes.c:56)
+ Uninitialised value was created by a stack allocation
+ at 0x........: main (origin1-yes.c:23)
+
+Undef 4 of 8 (mallocd, 32-bit)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: main (origin1-yes.c:64)
+ Uninitialised value was created by a heap allocation
+ at 0x........: malloc (vg_replace_malloc.c:...)
+ by 0x........: main (origin1-yes.c:61)
+
+Undef 5 of 8 (realloc)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: main (origin1-yes.c:76)
+ Uninitialised value was created by a heap allocation
+ at 0x........: realloc (vg_replace_malloc.c:...)
+ by 0x........: main (origin1-yes.c:71)
+
+Undef 6 of 8 (MALLOCLIKE_BLOCK)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: main (origin1-yes.c:85)
+ Uninitialised value was created by a heap allocation
+ at 0x........: main (origin1-yes.c:82)
+
+Undef 7 of 8 (brk)
+
+(no complaint; sbrk initialises memory on Darwin)
+
+Undef 8 of 8 (MAKE_MEM_UNDEFINED)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: main (origin1-yes.c:110)
+ Uninitialised value was created by a client request
+ at 0x........: main (origin1-yes.c:108)
+
+Def 1 of 3
+
+Def 2 of 3
+
+Def 3 of 3
|