You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(32) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
(8) |
2
(8) |
3
(15) |
4
(14) |
5
(12) |
6
(40) |
7
(9) |
|
8
(5) |
9
(12) |
10
(9) |
11
(13) |
12
(7) |
13
(7) |
14
(19) |
|
15
(18) |
16
(13) |
17
(16) |
18
(8) |
19
(16) |
20
(16) |
21
(12) |
|
22
(21) |
23
(39) |
24
(27) |
25
(33) |
26
(41) |
27
(17) |
28
(15) |
|
From: Bart V. A. <bar...@gm...> - 2009-02-26 13:06:48
|
On Thu, Feb 26, 2009 at 1:37 PM, Julian Seward <js...@ac...> wrote:
>
> > unit_libcbase.o:(.toc+0x78): undefined reference to `VKI_PAGE_SIZE'
>
> Not sure exactly what happened here, but ..
>
> VKI_PAGE_SIZE isn't a #defined constant on ppc{32,64}-linux -- it's a
> variable which is set at startup (of V). This is because on ppc64-linux
> there was a movement at one time to also support page sizes of 64k,
> although I think that has now been abandoned.
>
> One easy fix is just to do the test with VKI_MAX_PAGE_SIZE, which
> afaict is a constant on all platforms.
AFAIK the source file memcheck/tests/unit_libcbase.c includes the
source file coregrind/m_libcbase.c. And in the header file
include/vki/vki-ppc64-linux.h I found the following:
extern unsigned long VKI_PAGE_SIZE;
So adding the following line to unit_libcbase.c will probably solve this issue:
unsigned long VKI_PAGE_SIZE = VKI_MAX_PAGE_SIZE;
Bart.
|
|
From: Bart V. A. <bar...@gm...> - 2009-02-26 12:55:09
|
Nightly build on georgia-tech-cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) started at 2009-02-26 04:57:18 EST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 406 tests, 40 stderr failures, 9 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stderr) exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/fp (stderr) exp-ptrcheck/tests/globalerr (stderr) exp-ptrcheck/tests/hackedbz2 (stderr) exp-ptrcheck/tests/hp_bounds (stderr) exp-ptrcheck/tests/hp_dangle (stderr) exp-ptrcheck/tests/justify (stderr) exp-ptrcheck/tests/partial_bad (stderr) exp-ptrcheck/tests/partial_good (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) exp-ptrcheck/tests/realloc (stderr) exp-ptrcheck/tests/stackerr (stderr) exp-ptrcheck/tests/strcpy (stderr) exp-ptrcheck/tests/supp (stderr) exp-ptrcheck/tests/tricky (stderr) exp-ptrcheck/tests/unaligned (stderr) exp-ptrcheck/tests/zero (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/unit_libcbase (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/wrap8 (stderr) none/tests/faultstatus (stderr) none/tests/linux/mremap (stderr) none/tests/linux/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-vmx (stdout) none/tests/ppc32/round (stdout) none/tests/ppc32/test_gx (stdout) none/tests/ppc64/jm-fp (stdout) none/tests/ppc64/jm-vmx (stdout) none/tests/ppc64/round (stdout) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 406 tests, 39 stderr failures, 9 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stderr) exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/fp (stderr) exp-ptrcheck/tests/globalerr (stderr) exp-ptrcheck/tests/hackedbz2 (stderr) exp-ptrcheck/tests/hp_bounds (stderr) exp-ptrcheck/tests/hp_dangle (stderr) exp-ptrcheck/tests/justify (stderr) exp-ptrcheck/tests/partial_bad (stderr) exp-ptrcheck/tests/partial_good (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) exp-ptrcheck/tests/realloc (stderr) exp-ptrcheck/tests/stackerr (stderr) exp-ptrcheck/tests/strcpy (stderr) exp-ptrcheck/tests/supp (stderr) exp-ptrcheck/tests/tricky (stderr) exp-ptrcheck/tests/unaligned (stderr) exp-ptrcheck/tests/zero (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/wrap8 (stderr) none/tests/faultstatus (stderr) none/tests/linux/mremap (stderr) none/tests/linux/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-vmx (stdout) none/tests/ppc32/round (stdout) none/tests/ppc32/test_gx (stdout) none/tests/ppc64/jm-fp (stdout) none/tests/ppc64/jm-vmx (stdout) none/tests/ppc64/round (stdout) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short 2009-02-26 05:44:15.000000000 -0500 --- new.short 2009-02-26 06:30:32.000000000 -0500 *************** *** 8,10 **** ! == 406 tests, 39 stderr failures, 9 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stderr) --- 8,10 ---- ! == 406 tests, 40 stderr failures, 9 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stderr) *************** *** 38,39 **** --- 38,40 ---- memcheck/tests/pointer-trace (stderr) + memcheck/tests/unit_libcbase (stderr) memcheck/tests/varinfo1 (stderr) |
|
From: Konstantin S. <kon...@gm...> - 2009-02-26 10:41:57
|
On Wed, Feb 25, 2009 at 9:24 PM, Bart Van Assche <bar...@gm...> wrote: > On Wed, Feb 25, 2009 at 7:01 PM, Konstantin Serebryany > <kon...@gm...> wrote: >> On Wed, Feb 25, 2009 at 8:21 PM, Bart Van Assche >> <bar...@gm...> wrote: >>> On Tue, Feb 24, 2009 at 8:23 PM, Stefan Kost <en...@ho...> wrote: >>>> but then you can anyway do >>>> make CFLAGS=-Werror >>>> :) >>> >>> What will the above command to with the CFLAGS variable that has >>> already been defined in each Makefile ? >> >> make CFLAGS+=-Werror >> >> note "+=" > > I have tried the above command, but it had the same effect as make > CFLAGS=-Werror -- the CFLAGS defined in the Makefile were discarded. Oops. Yes, indeed. > > Bart. > |
|
From: Bart V. A. <bar...@gm...> - 2009-02-26 08:33:58
|
Hello Nicholas, Building the regression tests failed. I found the following error message in the logs: unit_libcbase.o:(.toc+0x78): undefined reference to `VKI_PAGE_SIZE' Can you please have a look at this ? Thanks, Bart. |
|
From: <sv...@va...> - 2009-02-26 04:07:30
|
Author: njn
Date: 2009-02-26 04:07:21 +0000 (Thu, 26 Feb 2009)
New Revision: 9273
Log:
Merge 9270..9272 (unit_libcbase.c updates) from the trunk.
Modified:
branches/DARWIN/coregrind/m_libcbase.c
branches/DARWIN/include/pub_tool_libcbase.h
branches/DARWIN/memcheck/tests/unit_libcbase.c
Modified: branches/DARWIN/coregrind/m_libcbase.c
===================================================================
--- branches/DARWIN/coregrind/m_libcbase.c 2009-02-26 04:02:03 UTC (rev 9272)
+++ branches/DARWIN/coregrind/m_libcbase.c 2009-02-26 04:07:21 UTC (rev 9273)
@@ -193,11 +193,11 @@
return dest_orig;
}
-Char* VG_(strpbrk) ( const Char* s, const Char* accept )
+Char* VG_(strpbrk) ( const Char* s, const Char* s2 )
{
const Char* a;
while (*s) {
- a = accept;
+ a = s2;
while (*a)
if (*a++ == *s)
return (Char *) s;
@@ -272,25 +272,6 @@
}
}
-static Bool isterm ( Char c )
-{
- return ( VG_(isspace)(c) || 0 == c );
-}
-
-Int VG_(strcmp_ws) ( const Char* s1, const Char* s2 )
-{
- while (True) {
- if (isterm(*s1) && isterm(*s2)) return 0;
- if (isterm(*s1)) return -1;
- if (isterm(*s2)) return 1;
-
- if (*(UChar*)s1 < *(UChar*)s2) return -1;
- if (*(UChar*)s1 > *(UChar*)s2) return 1;
-
- s1++; s2++;
- }
-}
-
Int VG_(strncmp) ( const Char* s1, const Char* s2, SizeT nmax )
{
SizeT n = 0;
@@ -327,22 +308,6 @@
}
}
-Int VG_(strncmp_ws) ( const Char* s1, const Char* s2, SizeT nmax )
-{
- Int n = 0;
- while (True) {
- if (n >= nmax) return 0;
- if (isterm(*s1) && isterm(*s2)) return 0;
- if (isterm(*s1)) return -1;
- if (isterm(*s2)) return 1;
-
- if (*(UChar*)s1 < *(UChar*)s2) return -1;
- if (*(UChar*)s1 > *(UChar*)s2) return 1;
-
- s1++; s2++; n++;
- }
-}
-
Char* VG_(strstr) ( const Char* haystack, Char* needle )
{
SizeT n;
@@ -391,12 +356,13 @@
return NULL;
}
-SizeT VG_(strspn) ( const Char* s, const Char* accept )
+// "2" suffix avoids shadowing problems in memcheck/tests/unit_libcbase.c.
+SizeT VG_(strspn) ( const Char* s, const Char* s2 )
{
const Char *p, *a;
SizeT count = 0;
for (p = s; *p != '\0'; ++p) {
- for (a = accept; *a != '\0'; ++a)
+ for (a = s2; *a != '\0'; ++a)
if (*p == *a)
break;
if (*a == '\0')
Modified: branches/DARWIN/include/pub_tool_libcbase.h
===================================================================
--- branches/DARWIN/include/pub_tool_libcbase.h 2009-02-26 04:02:03 UTC (rev 9272)
+++ branches/DARWIN/include/pub_tool_libcbase.h 2009-02-26 04:07:21 UTC (rev 9273)
@@ -94,10 +94,6 @@
extern SizeT VG_(strspn) ( const Char* s, const Char* __accept );
extern SizeT VG_(strcspn) ( const Char* s, const char* reject );
-/* Like strcmp() and strncmp(), but stop comparing at any whitespace. */
-extern Int VG_(strcmp_ws) ( const Char* s1, const Char* s2 );
-extern Int VG_(strncmp_ws) ( const Char* s1, const Char* s2, SizeT nmax );
-
/* Like strncpy(), but if 'src' is longer than 'ndest' inserts a '\0' as the
last character. */
extern void VG_(strncpy_safely) ( Char* dest, const Char* src, SizeT ndest );
@@ -141,7 +137,7 @@
Int (*compar)(void*, void*) );
/* Returns the base-2 logarithm of x. Returns -1 if x is not a power
- of two. */
+ of two. Nb: VG_(log2)(1) == 0. */
extern Int VG_(log2) ( UInt x );
// A pseudo-random number generator returning a random UInt. If pSeed
Modified: branches/DARWIN/memcheck/tests/unit_libcbase.c
===================================================================
--- branches/DARWIN/memcheck/tests/unit_libcbase.c 2009-02-26 04:02:03 UTC (rev 9272)
+++ branches/DARWIN/memcheck/tests/unit_libcbase.c 2009-02-26 04:07:21 UTC (rev 9273)
@@ -4,19 +4,265 @@
#include <stdio.h>
#include <stdlib.h>
-#include "coregrind/m_libcbase.c"
+#include "pub_tool_vki.h"
+#include "m_libcbase.c"
#define CHECK(x) \
if (!x) { fprintf(stderr, "failure: %s:%d\n", __FILE__, __LINE__); }
-void test_isXYZ(void)
+void test_VG_STREQ(void)
{
+ CHECK( ! VG_STREQ(NULL, NULL) ); // Nb: strcmp() considers these equal
+ CHECK( ! VG_STREQ(NULL, "ab") ); // Nb: strcmp() seg faults on this
+ CHECK( ! VG_STREQ("ab", NULL) ); // Nb: strcmp() seg faults on this
+ CHECK( ! VG_STREQ("", "a") );
+ CHECK( ! VG_STREQ("a", "") );
+ CHECK( ! VG_STREQ("abc", "abcd"));
+ CHECK( ! VG_STREQ("abcd", "abc") );
+ CHECK( ! VG_STREQ("Abcd", "abcd"));
+ CHECK( ! VG_STREQ("abcd", "Abcd"));
+
+ CHECK( VG_STREQ("", "") );
+ CHECK( VG_STREQ("a", "a") );
+ CHECK( VG_STREQ("abcd", "abcd") );
+}
+
+void test_VG_STREQN(void)
+{
+ CHECK( ! VG_STREQN(0, NULL, NULL) );
+ CHECK( ! VG_STREQN(5, NULL, NULL) );
+ CHECK( ! VG_STREQN(0, NULL, "ab") );
+ CHECK( ! VG_STREQN(5, NULL, "ab") );
+ CHECK( ! VG_STREQN(0, "ab", NULL) );
+ CHECK( ! VG_STREQN(1, "", "a") );
+ CHECK( ! VG_STREQN(1, "a", "") );
+ CHECK( ! VG_STREQN(4, "abc", "abcd"));
+ CHECK( ! VG_STREQN(4, "abcd", "abc") );
+ CHECK( ! VG_STREQN(1, "Abcd", "abcd"));
+ CHECK( ! VG_STREQN(4, "Abcd", "abcd"));
+ CHECK( ! VG_STREQN(4, "abcd", "abce"));
+ CHECK( ! VG_STREQN(9, "abcd", "abce"));
+
+ CHECK( VG_STREQN(0, "", "") );
+ CHECK( VG_STREQN(1, "", "") );
+ CHECK( VG_STREQN(0, "a", "a") );
+ CHECK( VG_STREQN(1, "a", "a") );
+ CHECK( VG_STREQN(2, "a", "a") );
+ CHECK( VG_STREQN(9, "a", "a") );
+ CHECK( VG_STREQN(1, "ab", "ac"));
+ CHECK( VG_STREQN(3, "abcd", "abce"));
+}
+
+void test_VG_IS_XYZ_ALIGNED(void)
+{
+ CHECK( VG_IS_2_ALIGNED(0x0) );
+ CHECK( ! VG_IS_2_ALIGNED(0x1) );
+ CHECK( VG_IS_2_ALIGNED(0x2) );
+ CHECK( ! VG_IS_2_ALIGNED(0x3) );
+ CHECK( VG_IS_2_ALIGNED(0x4) );
+ CHECK( ! VG_IS_2_ALIGNED(0x5) );
+ CHECK( VG_IS_2_ALIGNED(0x6) );
+ CHECK( ! VG_IS_2_ALIGNED(0x7) );
+ CHECK( VG_IS_2_ALIGNED(0x8) );
+ CHECK( ! VG_IS_2_ALIGNED(0x9) );
+ CHECK( VG_IS_2_ALIGNED(0xa) );
+ CHECK( ! VG_IS_2_ALIGNED(0xb) );
+ CHECK( VG_IS_2_ALIGNED(0xc) );
+ CHECK( ! VG_IS_2_ALIGNED(0xd) );
+ CHECK( VG_IS_2_ALIGNED(0xe) );
+ CHECK( ! VG_IS_2_ALIGNED(0xf) );
+
+ CHECK( VG_IS_4_ALIGNED(0x0) );
+ CHECK( ! VG_IS_4_ALIGNED(0x1) );
+ CHECK( ! VG_IS_4_ALIGNED(0x2) );
+ CHECK( ! VG_IS_4_ALIGNED(0x3) );
+ CHECK( VG_IS_4_ALIGNED(0x4) );
+ CHECK( ! VG_IS_4_ALIGNED(0x5) );
+ CHECK( ! VG_IS_4_ALIGNED(0x6) );
+ CHECK( ! VG_IS_4_ALIGNED(0x7) );
+ CHECK( VG_IS_4_ALIGNED(0x8) );
+ CHECK( ! VG_IS_4_ALIGNED(0x9) );
+ CHECK( ! VG_IS_4_ALIGNED(0xa) );
+ CHECK( ! VG_IS_4_ALIGNED(0xb) );
+ CHECK( VG_IS_4_ALIGNED(0xc) );
+ CHECK( ! VG_IS_4_ALIGNED(0xd) );
+ CHECK( ! VG_IS_4_ALIGNED(0xe) );
+ CHECK( ! VG_IS_4_ALIGNED(0xf) );
+
+ CHECK( VG_IS_8_ALIGNED(0x0) );
+ CHECK( ! VG_IS_8_ALIGNED(0x1) );
+ CHECK( ! VG_IS_8_ALIGNED(0x2) );
+ CHECK( ! VG_IS_8_ALIGNED(0x3) );
+ CHECK( ! VG_IS_8_ALIGNED(0x4) );
+ CHECK( ! VG_IS_8_ALIGNED(0x5) );
+ CHECK( ! VG_IS_8_ALIGNED(0x6) );
+ CHECK( ! VG_IS_8_ALIGNED(0x7) );
+ CHECK( VG_IS_8_ALIGNED(0x8) );
+ CHECK( ! VG_IS_8_ALIGNED(0x9) );
+ CHECK( ! VG_IS_8_ALIGNED(0xa) );
+ CHECK( ! VG_IS_8_ALIGNED(0xb) );
+ CHECK( ! VG_IS_8_ALIGNED(0xc) );
+ CHECK( ! VG_IS_8_ALIGNED(0xd) );
+ CHECK( ! VG_IS_8_ALIGNED(0xe) );
+ CHECK( ! VG_IS_8_ALIGNED(0xf) );
+
+ CHECK( VG_IS_16_ALIGNED(0x0) );
+ CHECK( ! VG_IS_16_ALIGNED(0x1) );
+ CHECK( ! VG_IS_16_ALIGNED(0x2) );
+ CHECK( ! VG_IS_16_ALIGNED(0x3) );
+ CHECK( ! VG_IS_16_ALIGNED(0x4) );
+ CHECK( ! VG_IS_16_ALIGNED(0x5) );
+ CHECK( ! VG_IS_16_ALIGNED(0x6) );
+ CHECK( ! VG_IS_16_ALIGNED(0x7) );
+ CHECK( ! VG_IS_16_ALIGNED(0x8) );
+ CHECK( ! VG_IS_16_ALIGNED(0x9) );
+ CHECK( ! VG_IS_16_ALIGNED(0xa) );
+ CHECK( ! VG_IS_16_ALIGNED(0xb) );
+ CHECK( ! VG_IS_16_ALIGNED(0xc) );
+ CHECK( ! VG_IS_16_ALIGNED(0xd) );
+ CHECK( ! VG_IS_16_ALIGNED(0xe) );
+ CHECK( ! VG_IS_16_ALIGNED(0xf) );
+
+ CHECK( VG_IS_WORD_ALIGNED(0x0) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x1) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x2) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x3) );
+ // 0x4 case below
+ CHECK( ! VG_IS_WORD_ALIGNED(0x5) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x6) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x7) );
+ CHECK( VG_IS_WORD_ALIGNED(0x8) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x9) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xa) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xb) );
+ // 0xc case below
+ CHECK( ! VG_IS_WORD_ALIGNED(0xd) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xe) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xf) );
+ if (4 == sizeof(void*)) {
+ CHECK( VG_IS_WORD_ALIGNED(0x4) );
+ CHECK( VG_IS_WORD_ALIGNED(0xc) );
+ } else if (8 == sizeof(void*)) {
+ CHECK( ! VG_IS_WORD_ALIGNED(0x4) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xc) );
+ } else {
+ assert(0);
+ }
+
+ CHECK( VG_IS_PAGE_ALIGNED(0x0) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(0x1) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(0x2) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(0x3) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(0x4) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(VKI_PAGE_SIZE-1) );
+ CHECK( VG_IS_PAGE_ALIGNED(VKI_PAGE_SIZE ) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(VKI_PAGE_SIZE+1) );
+}
+
+void test_VG_ROUND_et_al()
+{
+ CHECK( 0 == VG_ROUNDDN(0, 1) );
+ CHECK( 1 == VG_ROUNDDN(1, 1) );
+ CHECK( 2 == VG_ROUNDDN(2, 1) );
+ CHECK( 3 == VG_ROUNDDN(3, 1) );
+ CHECK( 4 == VG_ROUNDDN(4, 1) );
+ CHECK( 5 == VG_ROUNDDN(5, 1) );
+ CHECK( 6 == VG_ROUNDDN(6, 1) );
+ CHECK( 7 == VG_ROUNDDN(7, 1) );
+
+ CHECK( 0 == VG_ROUNDUP(0, 1) );
+ CHECK( 1 == VG_ROUNDUP(1, 1) );
+ CHECK( 2 == VG_ROUNDUP(2, 1) );
+ CHECK( 3 == VG_ROUNDUP(3, 1) );
+ CHECK( 4 == VG_ROUNDUP(4, 1) );
+ CHECK( 5 == VG_ROUNDUP(5, 1) );
+ CHECK( 6 == VG_ROUNDUP(6, 1) );
+ CHECK( 7 == VG_ROUNDUP(7, 1) );
+
+ CHECK( 0 == VG_ROUNDDN(0, 2) );
+ CHECK( 0 == VG_ROUNDDN(1, 2) );
+ CHECK( 2 == VG_ROUNDDN(2, 2) );
+ CHECK( 2 == VG_ROUNDDN(3, 2) );
+ CHECK( 4 == VG_ROUNDDN(4, 2) );
+ CHECK( 4 == VG_ROUNDDN(5, 2) );
+ CHECK( 6 == VG_ROUNDDN(6, 2) );
+ CHECK( 6 == VG_ROUNDDN(7, 2) );
+
+ CHECK( 0 == VG_ROUNDUP(0, 2) );
+ CHECK( 2 == VG_ROUNDUP(1, 2) );
+ CHECK( 2 == VG_ROUNDUP(2, 2) );
+ CHECK( 4 == VG_ROUNDUP(3, 2) );
+ CHECK( 4 == VG_ROUNDUP(4, 2) );
+ CHECK( 6 == VG_ROUNDUP(5, 2) );
+ CHECK( 6 == VG_ROUNDUP(6, 2) );
+ CHECK( 8 == VG_ROUNDUP(7, 2) );
+
+ CHECK( 0 == VG_ROUNDDN(0, 4) );
+ CHECK( 0 == VG_ROUNDDN(1, 4) );
+ CHECK( 0 == VG_ROUNDDN(2, 4) );
+ CHECK( 0 == VG_ROUNDDN(3, 4) );
+ CHECK( 4 == VG_ROUNDDN(4, 4) );
+ CHECK( 4 == VG_ROUNDDN(5, 4) );
+ CHECK( 4 == VG_ROUNDDN(6, 4) );
+ CHECK( 4 == VG_ROUNDDN(7, 4) );
+
+ CHECK( 0 == VG_ROUNDUP(0, 4) );
+ CHECK( 4 == VG_ROUNDUP(1, 4) );
+ CHECK( 4 == VG_ROUNDUP(2, 4) );
+ CHECK( 4 == VG_ROUNDUP(3, 4) );
+ CHECK( 4 == VG_ROUNDUP(4, 4) );
+ CHECK( 8 == VG_ROUNDUP(5, 4) );
+ CHECK( 8 == VG_ROUNDUP(6, 4) );
+ CHECK( 8 == VG_ROUNDUP(7, 4) );
+
+ CHECK( 0 == VG_ROUNDDN(0, 8) );
+ CHECK( 0 == VG_ROUNDDN(1, 8) );
+ CHECK( 0 == VG_ROUNDDN(2, 8) );
+ CHECK( 0 == VG_ROUNDDN(3, 8) );
+ CHECK( 0 == VG_ROUNDDN(4, 8) );
+ CHECK( 0 == VG_ROUNDDN(5, 8) );
+ CHECK( 0 == VG_ROUNDDN(6, 8) );
+ CHECK( 0 == VG_ROUNDDN(7, 8) );
+
+ CHECK( 0 == VG_ROUNDUP(0, 8) );
+ CHECK( 8 == VG_ROUNDUP(1, 8) );
+ CHECK( 8 == VG_ROUNDUP(2, 8) );
+ CHECK( 8 == VG_ROUNDUP(3, 8) );
+ CHECK( 8 == VG_ROUNDUP(4, 8) );
+ CHECK( 8 == VG_ROUNDUP(5, 8) );
+ CHECK( 8 == VG_ROUNDUP(6, 8) );
+ CHECK( 8 == VG_ROUNDUP(7, 8) );
+
+ CHECK( 0 == VG_PGROUNDDN(0) );
+ CHECK( 0 == VG_PGROUNDDN(1) );
+ CHECK( 0 == VG_PGROUNDDN(2) );
+ CHECK( 0 == VG_PGROUNDDN(3) );
+ CHECK( 0 == VG_PGROUNDDN(4) );
+ CHECK( 0 == VG_PGROUNDDN(VKI_PAGE_SIZE-1) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDDN(VKI_PAGE_SIZE ) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDDN(VKI_PAGE_SIZE+1) );
+
+ CHECK( 0 == VG_PGROUNDUP(0) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(1) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(2) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(3) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(4) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(VKI_PAGE_SIZE-1) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(VKI_PAGE_SIZE ) );
+ CHECK( VKI_PAGE_SIZE*2 == VG_PGROUNDUP(VKI_PAGE_SIZE+1) );
+}
+
+void test_isspace(void)
+{
CHECK( VG_(isspace)(' ') );
CHECK( VG_(isspace)('\n') );
CHECK( VG_(isspace)('\t') );
CHECK( ! VG_(isspace)('3') );
CHECK( ! VG_(isspace)('x') );
+}
+void test_isdigit(void)
+{
CHECK( VG_(isdigit)('0') );
CHECK( VG_(isdigit)('1') );
CHECK( VG_(isdigit)('5') );
@@ -25,14 +271,17 @@
CHECK( ! VG_(isdigit)('!') );
}
-void test_is_XYZ_digit()
+void test_is_dec_digit()
{
Long x;
-
CHECK( is_dec_digit('0', &x) && 0 == x );
CHECK( is_dec_digit('1', &x) && 1 == x );
CHECK( is_dec_digit('9', &x) && 9 == x );
+}
+void test_is_hex_digit()
+{
+ Long x;
CHECK( is_hex_digit('0', &x) && 0 == x );
CHECK( is_hex_digit('1', &x) && 1 == x );
CHECK( is_hex_digit('9', &x) && 9 == x );
@@ -42,7 +291,7 @@
CHECK( is_hex_digit('F', &x) && 15 == x );
}
-void test_strtoll(void)
+void test_strtoll_and_strtod(void)
{
// For VG_(strtoll*)()
typedef struct {
@@ -156,38 +405,98 @@
// XXX: todo
}
+void test_log2(void)
+{
+ CHECK( -1 == VG_(log2)(0) );
+ CHECK( 0 == VG_(log2)(1) );
+ CHECK( 1 == VG_(log2)(2) );
+ CHECK( -1 == VG_(log2)(3) );
+ CHECK( 2 == VG_(log2)(4) );
+ CHECK( -1 == VG_(log2)(5) );
+ CHECK( -1 == VG_(log2)(6) );
+ CHECK( -1 == VG_(log2)(7) );
+ CHECK( 3 == VG_(log2)(8) );
+
+ CHECK( -1 == VG_(log2)( 15) );
+ CHECK( 4 == VG_(log2)( 16) );
+ CHECK( -1 == VG_(log2)( 17) );
+
+ CHECK( -1 == VG_(log2)( 63) );
+ CHECK( 6 == VG_(log2)( 64) );
+ CHECK( -1 == VG_(log2)( 65) );
+
+ CHECK( -1 == VG_(log2)(255) );
+ CHECK( 8 == VG_(log2)(256) );
+ CHECK( -1 == VG_(log2)(257) );
+
+ CHECK( -1 == VG_(log2)(65535) );
+ CHECK( 16 == VG_(log2)(65536) );
+ CHECK( -1 == VG_(log2)(65537) );
+
+ CHECK( -1 == VG_(log2)(16777215) );
+ CHECK( 24 == VG_(log2)(16777216) );
+ CHECK( -1 == VG_(log2)(16777217) );
+
+ CHECK( -1 == VG_(log2)(2147483647U) );
+ CHECK( 31 == VG_(log2)(2147483648U) );
+ CHECK( -1 == VG_(log2)(2147483649U) );
+
+ CHECK( -1 == VG_(log2)(4294967295U) ); // Max UInt
+}
+
+void test_random(void)
+{
+ // Hmm, it's really hard to unit test a pseudo-random number generator.
+ // So no testing here, sorry.
+}
+
+//-----------------------------------------------------------------------
+// main
+//-----------------------------------------------------------------------
+
int main(void)
{
+ // Nb: the order of the tests is based on the order of the code in
+ // m_libcbase.c, except that macros defined in pub_tool_libcbase.h are
+ // tested first.
+
//--------------------------------------------------------------------
- // Macros in pub_tool_libcbase.h
+ // pub_tool_libcbase.h macros
//--------------------------------------------------------------------
- // XXX: todo
+ test_VG_STREQ();
+ test_VG_STREQN();
+ test_VG_IS_XYZ_ALIGNED();
+ test_VG_ROUND_et_al();
//--------------------------------------------------------------------
// Char functions
//--------------------------------------------------------------------
- test_isXYZ();
+ test_isspace();
+ test_isdigit();
//--------------------------------------------------------------------
// String-to-number functions
//--------------------------------------------------------------------
- test_is_XYZ_digit();
- test_strtoll();
+ test_is_dec_digit();
+ test_is_hex_digit();
+ test_strtoll_and_strtod();
//--------------------------------------------------------------------
// String functions
//--------------------------------------------------------------------
- // XXX: todo
+ // XXX: more todo: VG_(str_*)
//--------------------------------------------------------------------
// Mem functions
//--------------------------------------------------------------------
- // XXX: todo
+ // XXX: todo: VG_(mem*)
//--------------------------------------------------------------------
// Miscellaneous functions
//--------------------------------------------------------------------
- // XXX: todo
+ // XXX: todo: VG_(ssort)
+ test_log2();
+ test_random();
return 0;
}
|
|
From: <sv...@va...> - 2009-02-26 04:02:18
|
Author: njn
Date: 2009-02-26 04:02:03 +0000 (Thu, 26 Feb 2009)
New Revision: 9272
Log:
rename a function
Modified:
trunk/memcheck/tests/unit_libcbase.c
Modified: trunk/memcheck/tests/unit_libcbase.c
===================================================================
--- trunk/memcheck/tests/unit_libcbase.c 2009-02-26 03:56:48 UTC (rev 9271)
+++ trunk/memcheck/tests/unit_libcbase.c 2009-02-26 04:02:03 UTC (rev 9272)
@@ -53,7 +53,7 @@
CHECK( VG_STREQN(3, "abcd", "abce"));
}
-void test_VG_IS_XXX_ALIGNED(void)
+void test_VG_IS_XYZ_ALIGNED(void)
{
CHECK( VG_IS_2_ALIGNED(0x0) );
CHECK( ! VG_IS_2_ALIGNED(0x1) );
@@ -465,7 +465,7 @@
//--------------------------------------------------------------------
test_VG_STREQ();
test_VG_STREQN();
- test_VG_IS_XXX_ALIGNED();
+ test_VG_IS_XYZ_ALIGNED();
test_VG_ROUND_et_al();
//--------------------------------------------------------------------
|
|
From: <sv...@va...> - 2009-02-26 03:57:06
|
Author: njn
Date: 2009-02-26 03:56:48 +0000 (Thu, 26 Feb 2009)
New Revision: 9271
Log:
Avoid a warning.
Modified:
trunk/memcheck/tests/unit_libcbase.c
Modified: trunk/memcheck/tests/unit_libcbase.c
===================================================================
--- trunk/memcheck/tests/unit_libcbase.c 2009-02-26 03:52:35 UTC (rev 9270)
+++ trunk/memcheck/tests/unit_libcbase.c 2009-02-26 03:56:48 UTC (rev 9271)
@@ -442,7 +442,6 @@
CHECK( -1 == VG_(log2)(2147483649U) );
CHECK( -1 == VG_(log2)(4294967295U) ); // Max UInt
- CHECK( -1 == VG_(log2)(4294967296U) ); // Wraps to 0, so answer is -1
}
void test_random(void)
|
|
From: <sv...@va...> - 2009-02-26 03:53:05
|
Author: njn
Date: 2009-02-26 03:52:35 +0000 (Thu, 26 Feb 2009)
New Revision: 9270
Log:
Add more testing to memcheck/tests/unit_libcbase.c.
Remove VG_(strcmp_ws) and VG_(strncmp_ws); they're no longer needed by CLO
handling, and they're not much use elsewhere.
Modified:
trunk/coregrind/m_libcbase.c
trunk/include/pub_tool_libcbase.h
trunk/memcheck/tests/unit_libcbase.c
Modified: trunk/coregrind/m_libcbase.c
===================================================================
--- trunk/coregrind/m_libcbase.c 2009-02-26 02:45:55 UTC (rev 9269)
+++ trunk/coregrind/m_libcbase.c 2009-02-26 03:52:35 UTC (rev 9270)
@@ -247,25 +247,6 @@
}
}
-static Bool isterm ( Char c )
-{
- return ( VG_(isspace)(c) || 0 == c );
-}
-
-Int VG_(strcmp_ws) ( const Char* s1, const Char* s2 )
-{
- while (True) {
- if (isterm(*s1) && isterm(*s2)) return 0;
- if (isterm(*s1)) return -1;
- if (isterm(*s2)) return 1;
-
- if (*(UChar*)s1 < *(UChar*)s2) return -1;
- if (*(UChar*)s1 > *(UChar*)s2) return 1;
-
- s1++; s2++;
- }
-}
-
Int VG_(strncmp) ( const Char* s1, const Char* s2, SizeT nmax )
{
SizeT n = 0;
@@ -282,22 +263,6 @@
}
}
-Int VG_(strncmp_ws) ( const Char* s1, const Char* s2, SizeT nmax )
-{
- Int n = 0;
- while (True) {
- if (n >= nmax) return 0;
- if (isterm(*s1) && isterm(*s2)) return 0;
- if (isterm(*s1)) return -1;
- if (isterm(*s2)) return 1;
-
- if (*(UChar*)s1 < *(UChar*)s2) return -1;
- if (*(UChar*)s1 > *(UChar*)s2) return 1;
-
- s1++; s2++; n++;
- }
-}
-
Char* VG_(strstr) ( const Char* haystack, Char* needle )
{
SizeT n;
Modified: trunk/include/pub_tool_libcbase.h
===================================================================
--- trunk/include/pub_tool_libcbase.h 2009-02-26 02:45:55 UTC (rev 9269)
+++ trunk/include/pub_tool_libcbase.h 2009-02-26 03:52:35 UTC (rev 9270)
@@ -93,10 +93,6 @@
extern SizeT VG_(strspn) ( const Char* s, const Char* accept );
extern SizeT VG_(strcspn) ( const Char* s, const char* reject );
-/* Like strcmp() and strncmp(), but stop comparing at any whitespace. */
-extern Int VG_(strcmp_ws) ( const Char* s1, const Char* s2 );
-extern Int VG_(strncmp_ws) ( const Char* s1, const Char* s2, SizeT nmax );
-
/* Like strncpy(), but if 'src' is longer than 'ndest' inserts a '\0' as the
last character. */
extern void VG_(strncpy_safely) ( Char* dest, const Char* src, SizeT ndest );
@@ -139,7 +135,7 @@
Int (*compar)(void*, void*) );
/* Returns the base-2 logarithm of x. Returns -1 if x is not a power
- of two. */
+ of two. Nb: VG_(log2)(1) == 0. */
extern Int VG_(log2) ( UInt x );
// A pseudo-random number generator returning a random UInt. If pSeed
Modified: trunk/memcheck/tests/unit_libcbase.c
===================================================================
--- trunk/memcheck/tests/unit_libcbase.c 2009-02-26 02:45:55 UTC (rev 9269)
+++ trunk/memcheck/tests/unit_libcbase.c 2009-02-26 03:52:35 UTC (rev 9270)
@@ -4,19 +4,265 @@
#include <stdio.h>
#include <stdlib.h>
-#include "coregrind/m_libcbase.c"
+#include "pub_tool_vki.h"
+#include "m_libcbase.c"
#define CHECK(x) \
if (!x) { fprintf(stderr, "failure: %s:%d\n", __FILE__, __LINE__); }
-void test_isXYZ(void)
+void test_VG_STREQ(void)
{
+ CHECK( ! VG_STREQ(NULL, NULL) ); // Nb: strcmp() considers these equal
+ CHECK( ! VG_STREQ(NULL, "ab") ); // Nb: strcmp() seg faults on this
+ CHECK( ! VG_STREQ("ab", NULL) ); // Nb: strcmp() seg faults on this
+ CHECK( ! VG_STREQ("", "a") );
+ CHECK( ! VG_STREQ("a", "") );
+ CHECK( ! VG_STREQ("abc", "abcd"));
+ CHECK( ! VG_STREQ("abcd", "abc") );
+ CHECK( ! VG_STREQ("Abcd", "abcd"));
+ CHECK( ! VG_STREQ("abcd", "Abcd"));
+
+ CHECK( VG_STREQ("", "") );
+ CHECK( VG_STREQ("a", "a") );
+ CHECK( VG_STREQ("abcd", "abcd") );
+}
+
+void test_VG_STREQN(void)
+{
+ CHECK( ! VG_STREQN(0, NULL, NULL) );
+ CHECK( ! VG_STREQN(5, NULL, NULL) );
+ CHECK( ! VG_STREQN(0, NULL, "ab") );
+ CHECK( ! VG_STREQN(5, NULL, "ab") );
+ CHECK( ! VG_STREQN(0, "ab", NULL) );
+ CHECK( ! VG_STREQN(1, "", "a") );
+ CHECK( ! VG_STREQN(1, "a", "") );
+ CHECK( ! VG_STREQN(4, "abc", "abcd"));
+ CHECK( ! VG_STREQN(4, "abcd", "abc") );
+ CHECK( ! VG_STREQN(1, "Abcd", "abcd"));
+ CHECK( ! VG_STREQN(4, "Abcd", "abcd"));
+ CHECK( ! VG_STREQN(4, "abcd", "abce"));
+ CHECK( ! VG_STREQN(9, "abcd", "abce"));
+
+ CHECK( VG_STREQN(0, "", "") );
+ CHECK( VG_STREQN(1, "", "") );
+ CHECK( VG_STREQN(0, "a", "a") );
+ CHECK( VG_STREQN(1, "a", "a") );
+ CHECK( VG_STREQN(2, "a", "a") );
+ CHECK( VG_STREQN(9, "a", "a") );
+ CHECK( VG_STREQN(1, "ab", "ac"));
+ CHECK( VG_STREQN(3, "abcd", "abce"));
+}
+
+void test_VG_IS_XXX_ALIGNED(void)
+{
+ CHECK( VG_IS_2_ALIGNED(0x0) );
+ CHECK( ! VG_IS_2_ALIGNED(0x1) );
+ CHECK( VG_IS_2_ALIGNED(0x2) );
+ CHECK( ! VG_IS_2_ALIGNED(0x3) );
+ CHECK( VG_IS_2_ALIGNED(0x4) );
+ CHECK( ! VG_IS_2_ALIGNED(0x5) );
+ CHECK( VG_IS_2_ALIGNED(0x6) );
+ CHECK( ! VG_IS_2_ALIGNED(0x7) );
+ CHECK( VG_IS_2_ALIGNED(0x8) );
+ CHECK( ! VG_IS_2_ALIGNED(0x9) );
+ CHECK( VG_IS_2_ALIGNED(0xa) );
+ CHECK( ! VG_IS_2_ALIGNED(0xb) );
+ CHECK( VG_IS_2_ALIGNED(0xc) );
+ CHECK( ! VG_IS_2_ALIGNED(0xd) );
+ CHECK( VG_IS_2_ALIGNED(0xe) );
+ CHECK( ! VG_IS_2_ALIGNED(0xf) );
+
+ CHECK( VG_IS_4_ALIGNED(0x0) );
+ CHECK( ! VG_IS_4_ALIGNED(0x1) );
+ CHECK( ! VG_IS_4_ALIGNED(0x2) );
+ CHECK( ! VG_IS_4_ALIGNED(0x3) );
+ CHECK( VG_IS_4_ALIGNED(0x4) );
+ CHECK( ! VG_IS_4_ALIGNED(0x5) );
+ CHECK( ! VG_IS_4_ALIGNED(0x6) );
+ CHECK( ! VG_IS_4_ALIGNED(0x7) );
+ CHECK( VG_IS_4_ALIGNED(0x8) );
+ CHECK( ! VG_IS_4_ALIGNED(0x9) );
+ CHECK( ! VG_IS_4_ALIGNED(0xa) );
+ CHECK( ! VG_IS_4_ALIGNED(0xb) );
+ CHECK( VG_IS_4_ALIGNED(0xc) );
+ CHECK( ! VG_IS_4_ALIGNED(0xd) );
+ CHECK( ! VG_IS_4_ALIGNED(0xe) );
+ CHECK( ! VG_IS_4_ALIGNED(0xf) );
+
+ CHECK( VG_IS_8_ALIGNED(0x0) );
+ CHECK( ! VG_IS_8_ALIGNED(0x1) );
+ CHECK( ! VG_IS_8_ALIGNED(0x2) );
+ CHECK( ! VG_IS_8_ALIGNED(0x3) );
+ CHECK( ! VG_IS_8_ALIGNED(0x4) );
+ CHECK( ! VG_IS_8_ALIGNED(0x5) );
+ CHECK( ! VG_IS_8_ALIGNED(0x6) );
+ CHECK( ! VG_IS_8_ALIGNED(0x7) );
+ CHECK( VG_IS_8_ALIGNED(0x8) );
+ CHECK( ! VG_IS_8_ALIGNED(0x9) );
+ CHECK( ! VG_IS_8_ALIGNED(0xa) );
+ CHECK( ! VG_IS_8_ALIGNED(0xb) );
+ CHECK( ! VG_IS_8_ALIGNED(0xc) );
+ CHECK( ! VG_IS_8_ALIGNED(0xd) );
+ CHECK( ! VG_IS_8_ALIGNED(0xe) );
+ CHECK( ! VG_IS_8_ALIGNED(0xf) );
+
+ CHECK( VG_IS_16_ALIGNED(0x0) );
+ CHECK( ! VG_IS_16_ALIGNED(0x1) );
+ CHECK( ! VG_IS_16_ALIGNED(0x2) );
+ CHECK( ! VG_IS_16_ALIGNED(0x3) );
+ CHECK( ! VG_IS_16_ALIGNED(0x4) );
+ CHECK( ! VG_IS_16_ALIGNED(0x5) );
+ CHECK( ! VG_IS_16_ALIGNED(0x6) );
+ CHECK( ! VG_IS_16_ALIGNED(0x7) );
+ CHECK( ! VG_IS_16_ALIGNED(0x8) );
+ CHECK( ! VG_IS_16_ALIGNED(0x9) );
+ CHECK( ! VG_IS_16_ALIGNED(0xa) );
+ CHECK( ! VG_IS_16_ALIGNED(0xb) );
+ CHECK( ! VG_IS_16_ALIGNED(0xc) );
+ CHECK( ! VG_IS_16_ALIGNED(0xd) );
+ CHECK( ! VG_IS_16_ALIGNED(0xe) );
+ CHECK( ! VG_IS_16_ALIGNED(0xf) );
+
+ CHECK( VG_IS_WORD_ALIGNED(0x0) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x1) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x2) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x3) );
+ // 0x4 case below
+ CHECK( ! VG_IS_WORD_ALIGNED(0x5) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x6) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x7) );
+ CHECK( VG_IS_WORD_ALIGNED(0x8) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0x9) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xa) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xb) );
+ // 0xc case below
+ CHECK( ! VG_IS_WORD_ALIGNED(0xd) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xe) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xf) );
+ if (4 == sizeof(void*)) {
+ CHECK( VG_IS_WORD_ALIGNED(0x4) );
+ CHECK( VG_IS_WORD_ALIGNED(0xc) );
+ } else if (8 == sizeof(void*)) {
+ CHECK( ! VG_IS_WORD_ALIGNED(0x4) );
+ CHECK( ! VG_IS_WORD_ALIGNED(0xc) );
+ } else {
+ assert(0);
+ }
+
+ CHECK( VG_IS_PAGE_ALIGNED(0x0) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(0x1) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(0x2) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(0x3) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(0x4) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(VKI_PAGE_SIZE-1) );
+ CHECK( VG_IS_PAGE_ALIGNED(VKI_PAGE_SIZE ) );
+ CHECK( ! VG_IS_PAGE_ALIGNED(VKI_PAGE_SIZE+1) );
+}
+
+void test_VG_ROUND_et_al()
+{
+ CHECK( 0 == VG_ROUNDDN(0, 1) );
+ CHECK( 1 == VG_ROUNDDN(1, 1) );
+ CHECK( 2 == VG_ROUNDDN(2, 1) );
+ CHECK( 3 == VG_ROUNDDN(3, 1) );
+ CHECK( 4 == VG_ROUNDDN(4, 1) );
+ CHECK( 5 == VG_ROUNDDN(5, 1) );
+ CHECK( 6 == VG_ROUNDDN(6, 1) );
+ CHECK( 7 == VG_ROUNDDN(7, 1) );
+
+ CHECK( 0 == VG_ROUNDUP(0, 1) );
+ CHECK( 1 == VG_ROUNDUP(1, 1) );
+ CHECK( 2 == VG_ROUNDUP(2, 1) );
+ CHECK( 3 == VG_ROUNDUP(3, 1) );
+ CHECK( 4 == VG_ROUNDUP(4, 1) );
+ CHECK( 5 == VG_ROUNDUP(5, 1) );
+ CHECK( 6 == VG_ROUNDUP(6, 1) );
+ CHECK( 7 == VG_ROUNDUP(7, 1) );
+
+ CHECK( 0 == VG_ROUNDDN(0, 2) );
+ CHECK( 0 == VG_ROUNDDN(1, 2) );
+ CHECK( 2 == VG_ROUNDDN(2, 2) );
+ CHECK( 2 == VG_ROUNDDN(3, 2) );
+ CHECK( 4 == VG_ROUNDDN(4, 2) );
+ CHECK( 4 == VG_ROUNDDN(5, 2) );
+ CHECK( 6 == VG_ROUNDDN(6, 2) );
+ CHECK( 6 == VG_ROUNDDN(7, 2) );
+
+ CHECK( 0 == VG_ROUNDUP(0, 2) );
+ CHECK( 2 == VG_ROUNDUP(1, 2) );
+ CHECK( 2 == VG_ROUNDUP(2, 2) );
+ CHECK( 4 == VG_ROUNDUP(3, 2) );
+ CHECK( 4 == VG_ROUNDUP(4, 2) );
+ CHECK( 6 == VG_ROUNDUP(5, 2) );
+ CHECK( 6 == VG_ROUNDUP(6, 2) );
+ CHECK( 8 == VG_ROUNDUP(7, 2) );
+
+ CHECK( 0 == VG_ROUNDDN(0, 4) );
+ CHECK( 0 == VG_ROUNDDN(1, 4) );
+ CHECK( 0 == VG_ROUNDDN(2, 4) );
+ CHECK( 0 == VG_ROUNDDN(3, 4) );
+ CHECK( 4 == VG_ROUNDDN(4, 4) );
+ CHECK( 4 == VG_ROUNDDN(5, 4) );
+ CHECK( 4 == VG_ROUNDDN(6, 4) );
+ CHECK( 4 == VG_ROUNDDN(7, 4) );
+
+ CHECK( 0 == VG_ROUNDUP(0, 4) );
+ CHECK( 4 == VG_ROUNDUP(1, 4) );
+ CHECK( 4 == VG_ROUNDUP(2, 4) );
+ CHECK( 4 == VG_ROUNDUP(3, 4) );
+ CHECK( 4 == VG_ROUNDUP(4, 4) );
+ CHECK( 8 == VG_ROUNDUP(5, 4) );
+ CHECK( 8 == VG_ROUNDUP(6, 4) );
+ CHECK( 8 == VG_ROUNDUP(7, 4) );
+
+ CHECK( 0 == VG_ROUNDDN(0, 8) );
+ CHECK( 0 == VG_ROUNDDN(1, 8) );
+ CHECK( 0 == VG_ROUNDDN(2, 8) );
+ CHECK( 0 == VG_ROUNDDN(3, 8) );
+ CHECK( 0 == VG_ROUNDDN(4, 8) );
+ CHECK( 0 == VG_ROUNDDN(5, 8) );
+ CHECK( 0 == VG_ROUNDDN(6, 8) );
+ CHECK( 0 == VG_ROUNDDN(7, 8) );
+
+ CHECK( 0 == VG_ROUNDUP(0, 8) );
+ CHECK( 8 == VG_ROUNDUP(1, 8) );
+ CHECK( 8 == VG_ROUNDUP(2, 8) );
+ CHECK( 8 == VG_ROUNDUP(3, 8) );
+ CHECK( 8 == VG_ROUNDUP(4, 8) );
+ CHECK( 8 == VG_ROUNDUP(5, 8) );
+ CHECK( 8 == VG_ROUNDUP(6, 8) );
+ CHECK( 8 == VG_ROUNDUP(7, 8) );
+
+ CHECK( 0 == VG_PGROUNDDN(0) );
+ CHECK( 0 == VG_PGROUNDDN(1) );
+ CHECK( 0 == VG_PGROUNDDN(2) );
+ CHECK( 0 == VG_PGROUNDDN(3) );
+ CHECK( 0 == VG_PGROUNDDN(4) );
+ CHECK( 0 == VG_PGROUNDDN(VKI_PAGE_SIZE-1) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDDN(VKI_PAGE_SIZE ) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDDN(VKI_PAGE_SIZE+1) );
+
+ CHECK( 0 == VG_PGROUNDUP(0) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(1) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(2) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(3) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(4) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(VKI_PAGE_SIZE-1) );
+ CHECK( VKI_PAGE_SIZE == VG_PGROUNDUP(VKI_PAGE_SIZE ) );
+ CHECK( VKI_PAGE_SIZE*2 == VG_PGROUNDUP(VKI_PAGE_SIZE+1) );
+}
+
+void test_isspace(void)
+{
CHECK( VG_(isspace)(' ') );
CHECK( VG_(isspace)('\n') );
CHECK( VG_(isspace)('\t') );
CHECK( ! VG_(isspace)('3') );
CHECK( ! VG_(isspace)('x') );
+}
+void test_isdigit(void)
+{
CHECK( VG_(isdigit)('0') );
CHECK( VG_(isdigit)('1') );
CHECK( VG_(isdigit)('5') );
@@ -25,14 +271,17 @@
CHECK( ! VG_(isdigit)('!') );
}
-void test_is_XYZ_digit()
+void test_is_dec_digit()
{
Long x;
-
CHECK( is_dec_digit('0', &x) && 0 == x );
CHECK( is_dec_digit('1', &x) && 1 == x );
CHECK( is_dec_digit('9', &x) && 9 == x );
+}
+void test_is_hex_digit()
+{
+ Long x;
CHECK( is_hex_digit('0', &x) && 0 == x );
CHECK( is_hex_digit('1', &x) && 1 == x );
CHECK( is_hex_digit('9', &x) && 9 == x );
@@ -42,7 +291,7 @@
CHECK( is_hex_digit('F', &x) && 15 == x );
}
-void test_strtoll(void)
+void test_strtoll_and_strtod(void)
{
// For VG_(strtoll*)()
typedef struct {
@@ -156,38 +405,99 @@
// XXX: todo
}
+void test_log2(void)
+{
+ CHECK( -1 == VG_(log2)(0) );
+ CHECK( 0 == VG_(log2)(1) );
+ CHECK( 1 == VG_(log2)(2) );
+ CHECK( -1 == VG_(log2)(3) );
+ CHECK( 2 == VG_(log2)(4) );
+ CHECK( -1 == VG_(log2)(5) );
+ CHECK( -1 == VG_(log2)(6) );
+ CHECK( -1 == VG_(log2)(7) );
+ CHECK( 3 == VG_(log2)(8) );
+
+ CHECK( -1 == VG_(log2)( 15) );
+ CHECK( 4 == VG_(log2)( 16) );
+ CHECK( -1 == VG_(log2)( 17) );
+
+ CHECK( -1 == VG_(log2)( 63) );
+ CHECK( 6 == VG_(log2)( 64) );
+ CHECK( -1 == VG_(log2)( 65) );
+
+ CHECK( -1 == VG_(log2)(255) );
+ CHECK( 8 == VG_(log2)(256) );
+ CHECK( -1 == VG_(log2)(257) );
+
+ CHECK( -1 == VG_(log2)(65535) );
+ CHECK( 16 == VG_(log2)(65536) );
+ CHECK( -1 == VG_(log2)(65537) );
+
+ CHECK( -1 == VG_(log2)(16777215) );
+ CHECK( 24 == VG_(log2)(16777216) );
+ CHECK( -1 == VG_(log2)(16777217) );
+
+ CHECK( -1 == VG_(log2)(2147483647U) );
+ CHECK( 31 == VG_(log2)(2147483648U) );
+ CHECK( -1 == VG_(log2)(2147483649U) );
+
+ CHECK( -1 == VG_(log2)(4294967295U) ); // Max UInt
+ CHECK( -1 == VG_(log2)(4294967296U) ); // Wraps to 0, so answer is -1
+}
+
+void test_random(void)
+{
+ // Hmm, it's really hard to unit test a pseudo-random number generator.
+ // So no testing here, sorry.
+}
+
+//-----------------------------------------------------------------------
+// main
+//-----------------------------------------------------------------------
+
int main(void)
{
+ // Nb: the order of the tests is based on the order of the code in
+ // m_libcbase.c, except that macros defined in pub_tool_libcbase.h are
+ // tested first.
+
//--------------------------------------------------------------------
- // Macros in pub_tool_libcbase.h
+ // pub_tool_libcbase.h macros
//--------------------------------------------------------------------
- // XXX: todo
+ test_VG_STREQ();
+ test_VG_STREQN();
+ test_VG_IS_XXX_ALIGNED();
+ test_VG_ROUND_et_al();
//--------------------------------------------------------------------
// Char functions
//--------------------------------------------------------------------
- test_isXYZ();
+ test_isspace();
+ test_isdigit();
//--------------------------------------------------------------------
// String-to-number functions
//--------------------------------------------------------------------
- test_is_XYZ_digit();
- test_strtoll();
+ test_is_dec_digit();
+ test_is_hex_digit();
+ test_strtoll_and_strtod();
//--------------------------------------------------------------------
// String functions
//--------------------------------------------------------------------
- // XXX: todo
+ // XXX: more todo: VG_(str_*)
//--------------------------------------------------------------------
// Mem functions
//--------------------------------------------------------------------
- // XXX: todo
+ // XXX: todo: VG_(mem*)
//--------------------------------------------------------------------
// Miscellaneous functions
//--------------------------------------------------------------------
- // XXX: todo
+ // XXX: todo: VG_(ssort)
+ test_log2();
+ test_random();
return 0;
}
|
|
From: Tom H. <th...@cy...> - 2009-02-26 03:48:24
|
Nightly build on vauxhall ( x86_64, Fedora 10 ) started at 2009-02-26 03:20:04 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 486 tests, 0 stderr failures, 0 stdout failures, 0 post failures == ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 489 tests, 0 stderr failures, 0 stdout failures, 0 post failures == ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Thu Feb 26 03:34:18 2009 --- new.short Thu Feb 26 03:48:18 2009 *************** *** 8,10 **** ! == 489 tests, 0 stderr failures, 0 stdout failures, 0 post failures == --- 8,10 ---- ! == 486 tests, 0 stderr failures, 0 stdout failures, 0 post failures == |
|
From: Tom H. <th...@cy...> - 2009-02-26 03:45:12
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2009-02-26 03:05:04 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 477 tests, 5 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) helgrind/tests/tc20_verifywrap (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 480 tests, 5 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) helgrind/tests/tc20_verifywrap (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Thu Feb 26 03:25:03 2009 --- new.short Thu Feb 26 03:45:02 2009 *************** *** 8,10 **** ! == 480 tests, 5 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) --- 8,10 ---- ! == 477 tests, 5 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) |
|
From: Tom H. <th...@cy...> - 2009-02-26 03:32:21
|
Nightly build on mg ( x86_64, Fedora 9 ) started at 2009-02-26 03:10:03 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 483 tests, 4 stderr failures, 2 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) memcheck/tests/linux/timerfd-syscall (stdout) none/tests/linux/mremap2 (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 486 tests, 4 stderr failures, 2 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) memcheck/tests/linux/timerfd-syscall (stdout) none/tests/linux/mremap2 (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Thu Feb 26 03:21:08 2009 --- new.short Thu Feb 26 03:32:07 2009 *************** *** 8,10 **** ! == 486 tests, 4 stderr failures, 2 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) --- 8,10 ---- ! == 483 tests, 4 stderr failures, 2 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) |
|
From: Nicholas N. <n.n...@gm...> - 2009-02-26 02:47:57
|
On Wed, Feb 25, 2009 at 5:56 PM, Bart Van Assche <bar...@gm...> wrote: > On Wed, Feb 25, 2009 at 3:50 AM, Nicholas Nethercote > <n.n...@gm...> wrote: >> x86/Linux assembly code and x86/Darwin assembly code appear to be >> different dialects. Some of the tests in none/tests/x86/ and >> memcheck/tests/x86/ compile on x86/Darwin, eg. >> memcheck/tests/bug152022. But some don't, eg. pushfpopf, because >> x86/Darwin assembler doesn't accept the .type and .size options. >> >> The easiest thing to do is move the ones that don't compile on Darwin >> into an x86-linux/ directory. Anyone have any strong opinons about >> this, or other insights? > > Which standards apply to x86 assembler syntax ? I'm not sure that there are any. This seems to be the definitive documentation on Mac/x86 assembly: http://developer.apple.com/DOCUMENTATION/DeveloperTools/Reference/Assembler/index.html Nick |
|
From: <sv...@va...> - 2009-02-26 02:46:01
|
Author: njn
Date: 2009-02-26 02:45:55 +0000 (Thu, 26 Feb 2009)
New Revision: 9269
Log:
Merge r9265 (generalise a couple of suppresions) from the trunk.
Modified:
branches/DARWIN/glibc-2.34567-NPTL-helgrind.supp
Modified: branches/DARWIN/glibc-2.34567-NPTL-helgrind.supp
===================================================================
--- branches/DARWIN/glibc-2.34567-NPTL-helgrind.supp 2009-02-25 23:25:02 UTC (rev 9268)
+++ branches/DARWIN/glibc-2.34567-NPTL-helgrind.supp 2009-02-26 02:45:55 UTC (rev 9269)
@@ -162,6 +162,7 @@
{
helgrind-qt4---QMutex::lock()-QMutex::lock()
Helgrind:Race
+ ...
fun:_ZN6QMutex4lockEv
fun:_ZN6QMutex4lockEv
}
@@ -169,6 +170,7 @@
{
helgrind-qt4---QMutex::unlock()-QMutex::unlock()
Helgrind:Race
+ ...
fun:_ZN6QMutex6unlockEv
fun:_ZN6QMutex6unlockEv
}
|
|
From: Nicholas N. <n.n...@gm...> - 2009-02-26 02:43:44
|
On Thu, Feb 26, 2009 at 11:10 AM, Nicholas Nethercote <n.n...@gm...> wrote: > Hi, > > Back when Valgrind tools were built as shared objects, we had this > notion of the binary interface version, so you could tell if a tool > would work with a particular version of the Valgrind core. > > Now that tools are statically linked with the core, this isn't > necessary. (IMHO this is excellent.) Turns out there was some > left-over cruft from this. The patch below gets rid of it. Any > objections? The main reason I'm asking is to make sure that Josef is > happy with removing the version-specific argv-handling code. Nb: In case it wasn't clear, this is purely dead code removal. The patch just removes stuff that hasn't been used for several years now. Nick |
|
From: Nicholas N. <n.n...@gm...> - 2009-02-26 00:25:52
|
On Thu, Feb 26, 2009 at 5:52 AM, Ivan Jager <aij...@an...> wrote: >> >> I propose changing the test to omit the +/- at the start of the >> answers (to remove +0 and -0 differences), to print 12 decimal places >> rather than 13 (to remove the difference in the 13th decimal place), >> and possibly to filter the sign of the exponent if its zero (to remove >> the difference between 1.0000e-00 and 1.0000e+00). > > Ok, what am I missing? IIRC the exponent part of an IEEE FP number is > represented by an integer, where the exponent is calculated by taking that > integer as unsigned and subtracting a constant. So, how is it possible to > have a different representation for 1.0000e-00 and 1.0000e+00? I don't know. Something in the printf() implementation? > Out of curiosity, are you encountering the differences on PPC or on an x86 > Mac? The only thing I can think of which could cause a diffirence on x86 > would be the compiler, since on Linux/x86 at least GCC defaults to not using > -ffloat-store. If I understand correctly, compiling the tests with > -ffloat-store should produce the same results as on any sane architecture, > however that would also mean the tests wouldn't be testing the extended > precision part of Valgrind/x86. x86 Mac. N |
|
From: Nicholas N. <n.n...@gm...> - 2009-02-26 00:10:15
|
Hi,
Back when Valgrind tools were built as shared objects, we had this
notion of the binary interface version, so you could tell if a tool
would work with a particular version of the Valgrind core.
Now that tools are statically linked with the core, this isn't
necessary. (IMHO this is excellent.) Turns out there was some
left-over cruft from this. The patch below gets rid of it. Any
objections? The main reason I'm asking is to make sure that Josef is
happy with removing the version-specific argv-handling code.
Nick
Index: callgrind/dump.c
===================================================================
--- callgrind/dump.c (revision 9264)
+++ callgrind/dump.c (working copy)
@@ -1640,7 +1640,6 @@
Int i,j,size = 0;
HChar* argv;
-#if VG_CORE_INTERFACE_VERSION > 8
if (VG_(args_the_exename))
size = VG_(sprintf)(cmdbuf, " %s", VG_(args_the_exename));
@@ -1651,15 +1650,6 @@
for(j=0;argv[j]!=0;j++)
if (size < BUF_LEN) cmdbuf[size++] = argv[j];
}
-#else
- for(i = 0; i < VG_(client_argc); i++) {
- argv = VG_(client_argv)[i];
- if (!argv) continue;
- if ((size>0) && (size < BUF_LEN)) cmdbuf[size++] = ' ';
- for(j=0;argv[j]!=0;j++)
- if (size < BUF_LEN) cmdbuf[size++] = argv[j];
- }
-#endif
if (size == BUF_LEN) size--;
cmdbuf[size] = 0;
Index: include/pub_tool_tooliface.h
===================================================================
--- include/pub_tool_tooliface.h (revision 9264)
+++ include/pub_tool_tooliface.h (working copy)
@@ -37,39 +37,23 @@
/* ------------------------------------------------------------------ */
/* The interface version */
-/* The version number indicates binary-incompatible changes to the
- interface; if the core and tool versions don't match, Valgrind
- will abort. */
-#define VG_CORE_INTERFACE_VERSION 11
+/* Initialise tool. Must do the following:
+ - initialise the `details' struct, via the VG_(details_*)() functions
+ - register the basic tool functions, via VG_(basic_tool_funcs)().
+ May do the following:
+ - initialise the `needs' struct to indicate certain requirements, via
+ the VG_(needs_*)() functions
+ - any other tool-specific initialisation
+*/
+extern void (*VG_(tl_pre_clo_init)) ( void );
-typedef struct _ToolInfo {
- Int sizeof_ToolInfo;
- Int interface_version;
+/* Every tool must include this macro somewhere, exactly once. The
+ interface version is no longer relevant, but we kept the same name
+ to avoid requiring changes to tools.
+*/
+#define VG_DETERMINE_INTERFACE_VERSION(pre_clo_init) \
+ void (*VG_(tl_pre_clo_init)) ( void ) = pre_clo_init;
- /* Initialise tool. Must do the following:
- - initialise the `details' struct, via the VG_(details_*)() functions
- - register any helpers called by generated code
-
- May do the following:
- - initialise the `needs' struct to indicate certain requirements, via
- the VG_(needs_*)() functions
- - initialize all the tool's entrypoints via the VG_(init_*)() functions
- - register any tool-specific profiling events
- - any other tool-specific initialisation
- */
- void (*tl_pre_clo_init) ( void );
-} ToolInfo;
-
-extern const ToolInfo VG_(tool_info);
-
-/* Every tool must include this macro somewhere, exactly once. */
-#define VG_DETERMINE_INTERFACE_VERSION(pre_clo_init) \
- const ToolInfo VG_(tool_info) = { \
- .sizeof_ToolInfo = sizeof(ToolInfo), \
- .interface_version = VG_CORE_INTERFACE_VERSION, \
- .tl_pre_clo_init = pre_clo_init, \
- };
-
/* ------------------------------------------------------------------ */
/* Basic tool functions */
Index: include/pub_tool_libcproc.h
===================================================================
--- include/pub_tool_libcproc.h (revision 9264)
+++ include/pub_tool_libcproc.h (working copy)
@@ -35,9 +35,7 @@
Command-line and environment stuff
------------------------------------------------------------------ */
-/* Client args and environment. Note that VG_(client_argv)[] can be written
- to by the client, so you should check each entry is non-NULL before
- printing. VG_(client_envp) can be inspected with VG_(getenv)(). */
+/* Client environment. */
extern Char** VG_(client_envp);
/* Looks up VG_(client_envp) */
Index: coregrind/m_main.c
===================================================================
--- coregrind/m_main.c (revision 9264)
+++ coregrind/m_main.c (working copy)
@@ -1585,7 +1585,7 @@
// p: setup_file_descriptors() [for 'VG_(fd_xxx_limit)']
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Initialise the tool part 1 (pre_clo_init)\n");
- (VG_(tool_info).tl_pre_clo_init)();
+ VG_(tl_pre_clo_init)();
//--------------------------------------------------------------
// If --tool and --help/--help-debug was given, now give the core+tool
|