]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Just as for the regression tests of other Valgrind tools, do not explicitly state...
authorBart Van Assche <bvanassche@acm.org>
Mon, 16 Feb 2009 19:42:17 +0000 (19:42 +0000)
committerBart Van Assche <bvanassche@acm.org>
Mon, 16 Feb 2009 19:42:17 +0000 (19:42 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9181

drd/tests/fp_race.c
drd/tests/fp_race.stderr.exp
drd/tests/pth_detached.c
drd/tests/pth_detached_sem.c
drd/tests/sem_as_mutex.c
drd/tests/sem_as_mutex.stderr.exp

index 69fa6648ff2666a7bbe4daad33b7f2a99df6b31c..bb9853e13ca1e39f96e3d4910fa294e64e5fbd18 100644 (file)
@@ -1,56 +1,33 @@
-/*
-  This file is part of drd, a data race detector.
+/* Test data race detection between floating point variables. */
 
-  Copyright (C) 2006-2008 Bart Van Assche
-  bart.vanassche@gmail.com
-
-  This program is free software; you can redistribute it and/or
-  modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307, USA.
-
-  The GNU General Public License is contained in the file COPYING.
-*/
-
-// Test data race detection between floating point variables.
 
 #include <assert.h>
-#include <stdio.h>      // printf()
+#include <stdio.h>     /* printf() */
 #include <pthread.h>
-#include <unistd.h>    // usleep()
-
+#include <unistd.h>    /* usleep() */
 
 
-// Local functions declarations.
+/* Local functions declarations. */
 
 static void* thread_func(void*);
 
-// Local variables.
 
-// s_mutex protects s_d3.
+/* Local variables. */
+
+/* s_mutex protects s_d3. */
 static pthread_mutex_t s_mutex;
 
-static double s_d1; // accessed before thread creation and in the created
-                    // thread (not a race).
-static double s_d2; // accessed in the created thread and after the join
-                    // (not a race).
-static double s_d3; // accessed simultaneously from both threads (race).
+static double s_d1; /* accessed before thread creation and in the created */
+                    /* thread (not a race). */
+static double s_d2; /* accessed in the created thread and after the join */
+                    /* (not a race). */
+static double s_d3; /* accessed simultaneously from both threads (race). */
 static int    s_debug     = 0;
 static int    s_do_printf = 0;
 static int    s_use_mutex = 0;
 
 
-// Function definitions.
+/* Function definitions. */
 
 int main(int argc, char** argv)
 {
@@ -77,8 +54,10 @@ int main(int argc, char** argv)
 
   pthread_mutex_init(&s_mutex, 0);
 
-  // Switch to line-buffered mode, such that timing information can be 
-  // obtained for each printf() call with strace.
+  /*
+   * Switch to line-buffered mode, such that timing information can be 
+   * obtained for each printf() call with strace.
+   */
   setlinebuf(stdout);
 
   if (s_debug)
@@ -90,7 +69,6 @@ int main(int argc, char** argv)
   s_d3 = 3;
 
   pthread_create(&threadid, 0, thread_func, 0);
-  // Wait until the printf() in the created thread finished.
 
   {
     if (s_use_mutex) pthread_mutex_lock(&s_mutex);
@@ -98,12 +76,8 @@ int main(int argc, char** argv)
     if (s_use_mutex) pthread_mutex_unlock(&s_mutex);
   }
 
-  // Wait until the thread finished.
-  //printf("Before call to pthread_join()\n");
-  //fflush(stdout);
+  /* Wait until the thread finished. */
   pthread_join(threadid, 0);
-  //printf("After call to pthread_join()\n");
-  //fflush(stdout);
   if (s_do_printf) printf("s_d2 = %g (should be 2)\n", s_d2);
   if (s_do_printf) printf("s_d3 = %g (should be 5)\n", s_d3);
 
index 8c509c70a7338d37a24d1c0a11b281e377780248..d71aa061d83180750c468b075a3e5a17bbacb220 100644 (file)
@@ -2,7 +2,7 @@
 Conflicting load by thread 1/1 at 0x........ size 8
    at 0x........: main (fp_race.c:?)
 Location 0x........ is 0 bytes inside local var "s_d3"
-declared at fp_race.c:47, in frame #? of thread 1
+declared at fp_race.c:24, in frame #? of thread 1
 Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
 Other segment end (thread 0/2)
@@ -11,7 +11,7 @@ Other segment end (thread 0/2)
 Conflicting store by thread 1/1 at 0x........ size 8
    at 0x........: main (fp_race.c:?)
 Location 0x........ is 0 bytes inside local var "s_d3"
-declared at fp_race.c:47, in frame #? of thread 1
+declared at fp_race.c:24, in frame #? of thread 1
 Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
 Other segment end (thread 0/2)
index 506693c181c88ac45969efacf0dcf2948a2a514a..a645b97c2a98e2b0e2b4aeac7f05070a27769b64 100644 (file)
@@ -1,6 +1,4 @@
-/** Test whether detached threads are handled properly.
- *  Copyright (c) 2006-2008 by Bart Van Assche (bart.vanassche@gmail.com).
- */
+/* Test whether detached threads are handled properly. */
 
 
 #include <assert.h>
index 27602ab6e384a949fae99dd1ddfea7db2a7c4b4f..4d0223c34503c0dd3937f535f6f0629ad8a9f709 100644 (file)
@@ -1,9 +1,9 @@
-/** Test whether detached threads are handled properly.
- *  This test program is based on pth_detached.c, with the difference that
- *  in this test program the main thread uses a counting semaphore instead
- *  of a counter protected by a mutex to wait until all detached threads
- *  finished.
- *  Copyright (c) 2006-2008 by Bart Van Assche (bart.vanassche@gmail.com).
+/**
+ * Test whether detached threads are handled properly.
+ * This test program is based on pth_detached.c, with the difference that
+ * in this test program the main thread uses a counting semaphore instead
+ * of a counter protected by a mutex to wait until all detached threads
+ * finished.
  */
 
 
index 1e23e1cc28512ae26b73b71356c3fd405b9c5e23..4b4ee9a0b6b642f9a87376ec88c4e7cbc16d73df 100644 (file)
@@ -1,57 +1,34 @@
-/*
-  This file is part of drd, a data race detector.
+/* Use a semaphore to implement mutual exclusion. */
 
-  Copyright (C) 2006-2008 Bart Van Assche
-  bart.vanassche@gmail.com
-
-  This program is free software; you can redistribute it and/or
-  modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307, USA.
-
-  The GNU General Public License is contained in the file COPYING.
-*/
-
-// Use a semaphore to implement mutual exclusion.
 
 #include <assert.h>
-#include <stdio.h>      // printf()
+#include <stdio.h>     /* printf() */
 #include <pthread.h>
 #include <semaphore.h>
-#include <unistd.h>    // usleep()
-
+#include <unistd.h>    /* usleep() */
 
 
-// Local functions declarations.
+/* Local functions declarations. */
 
 static void* thread_func(void*);
 
-// Local variables.
 
-// s_sem protects s_d3.
+/* Local variables. */
+
+/* s_sem protects s_d3. */
 static sem_t s_sem;
 
-static double s_d1; // accessed before thread creation and in the created
-                    // thread (not a race).
-static double s_d2; // accessed in the created thread and after the join
-                    // (not a race).
-static double s_d3; // accessed simultaneously from both threads (race).
+static double s_d1; /* accessed before thread creation and in the created */
+                    /* thread (not a race). */
+static double s_d2; /* accessed in the created thread and after the join */
+                    /* (not a race). */
+static double s_d3; /* accessed simultaneously from both threads (race). */
 static int    s_debug     = 0;
 static int    s_do_printf = 0;
 static int    s_do_mutual_exclusion = 0;
 
 
-// Function definitions.
+/* Function definitions. */
 
 int main(int argc, char** argv)
 {
@@ -78,8 +55,10 @@ int main(int argc, char** argv)
 
   sem_init(&s_sem, 0, 1);
 
-  // Switch to line-buffered mode, such that timing information can be 
-  // obtained for each printf() call with strace.
+  /*
+   * Switch to line-buffered mode, such that timing information can be 
+   * obtained for each printf() call with strace.
+   */
   setlinebuf(stdout);
 
   if (s_debug)
@@ -91,7 +70,6 @@ int main(int argc, char** argv)
   s_d3 = 3;
 
   pthread_create(&threadid, 0, thread_func, 0);
-  // Wait until the printf() in the created thread finished.
 
   {
     if (s_do_mutual_exclusion) sem_wait(&s_sem);
@@ -99,12 +77,8 @@ int main(int argc, char** argv)
     if (s_do_mutual_exclusion) sem_post(&s_sem);
   }
 
-  // Wait until the thread finished.
-  //printf("Before call to pthread_join()\n");
-  //fflush(stdout);
+  /* Wait until the thread finished. */
   pthread_join(threadid, 0);
-  //printf("After call to pthread_join()\n");
-  //fflush(stdout);
   if (s_do_printf) printf("s_d2 = %g (should be 2)\n", s_d2);
   if (s_do_printf) printf("s_d3 = %g (should be 5)\n", s_d3);
 
index b02899a281f2def696abeffc291d370de5ba0a18..55f92d0929ce88f520381312ec6fcfda4db975ec 100644 (file)
@@ -2,7 +2,7 @@
 Conflicting load by thread 1/1 at 0x........ size 8
    at 0x........: main (sem_as_mutex.c:?)
 Location 0x........ is 0 bytes inside local var "s_d3"
-declared at sem_as_mutex.c:48, in frame #? of thread 1
+declared at sem_as_mutex.c:25, in frame #? of thread 1
 Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
 Other segment end (thread 0/2)
@@ -11,7 +11,7 @@ Other segment end (thread 0/2)
 Conflicting store by thread 1/1 at 0x........ size 8
    at 0x........: main (sem_as_mutex.c:?)
 Location 0x........ is 0 bytes inside local var "s_d3"
-declared at sem_as_mutex.c:48, in frame #? of thread 1
+declared at sem_as_mutex.c:25, in frame #? of thread 1
 Other segment start (thread 0/2)
    (thread finished, call stack no longer available)
 Other segment end (thread 0/2)