|
From: <sv...@va...> - 2009-08-11 15:01:11
|
Author: bart
Date: 2009-08-11 16:00:54 +0100 (Tue, 11 Aug 2009)
New Revision: 10779
Log:
Added regression test for ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() and
ANNOTATE_IGNORE_READS_AND_WRITES_END().
Added:
trunk/drd/tests/annotate_ignore_rw.c
trunk/drd/tests/annotate_ignore_rw.stderr.exp
trunk/drd/tests/annotate_ignore_rw.vgtest
trunk/drd/tests/annotate_ignore_rw2.stderr.exp
trunk/drd/tests/annotate_ignore_rw2.vgtest
Modified:
trunk/drd/tests/
trunk/drd/tests/Makefile.am
Property changes on: trunk/drd/tests
___________________________________________________________________
Name: svn:ignore
- *.dSYM
*.stderr.diff*
*.stderr.out
*.stdout.diff*
*.stdout.out
.deps
annotate_rwlock
atomic_var
bar_bad
bar_trivial
boost_thread
circular_buffer
custom_alloc
drd_bitmap_test
fp_race
hg01_all_ok
hg02_deadlock
hg03_inherit
hg04_race
hg05_race2
hg06_readshared
hold_lock
linuxthreads_det
Makefile
Makefile.in
matinv
memory_allocation
monitor_example
new_delete
omp_matinv
omp_prime
omp_printf
pth_barrier
pth_barrier_race
pth_barrier_reinit
pth_broadcast
pth_cancel_locked
pth_cleanup_handler
pth_cond_race
pth_create_chain
pth_create_glibc_2_0
pth_detached
pth_detached_sem
pth_inconsistent_cond_wait
pth_mutex_reinit
pth_process_shared_mutex
pth_spinlock
qt4_mutex
qt4_rwlock
qt4_semaphore
recursive_mutex
rwlock_race
rwlock_test
rwlock_type_checking
sem_as_mutex
sem_open
sigalrm
tc01_simple_race
tc02_simple_tls
tc03_re_excl
tc04_free_lock
tc05_simple_race
tc06_two_races
tc07_hbl1
tc08_hbl2
tc09_bad_unlock
tc10_rec_lock
tc11_XCHG
tc12_rwl_trivial
tc13_laog1
tc15_laog_lockdel
tc16_byterace
tc17_sembar
tc18_semabuse
tc19_shadowmem
tc20_verifywrap
tc21_pthonce
tc22_exit_w_lock
tc23_bogus_condwait
tc24_nonzero_sem
thread_name
trylock
tsan_unittest
unit_bitmap
unit_vc
vg_regtest.tmp*
+ *.dSYM
*.stderr.diff*
*.stderr.out
*.stdout.diff*
*.stdout.out
.deps
annotate_ignore_rw
annotate_rwlock
atomic_var
bar_bad
bar_trivial
boost_thread
circular_buffer
custom_alloc
drd_bitmap_test
fp_race
hg01_all_ok
hg02_deadlock
hg03_inherit
hg04_race
hg05_race2
hg06_readshared
hold_lock
linuxthreads_det
Makefile
Makefile.in
matinv
memory_allocation
monitor_example
new_delete
omp_matinv
omp_prime
omp_printf
pth_barrier
pth_barrier_race
pth_barrier_reinit
pth_broadcast
pth_cancel_locked
pth_cleanup_handler
pth_cond_race
pth_create_chain
pth_create_glibc_2_0
pth_detached
pth_detached_sem
pth_inconsistent_cond_wait
pth_mutex_reinit
pth_process_shared_mutex
pth_spinlock
qt4_mutex
qt4_rwlock
qt4_semaphore
recursive_mutex
rwlock_race
rwlock_test
rwlock_type_checking
sem_as_mutex
sem_open
sigalrm
tc01_simple_race
tc02_simple_tls
tc03_re_excl
tc04_free_lock
tc05_simple_race
tc06_two_races
tc07_hbl1
tc08_hbl2
tc09_bad_unlock
tc10_rec_lock
tc11_XCHG
tc12_rwl_trivial
tc13_laog1
tc15_laog_lockdel
tc16_byterace
tc17_sembar
tc18_semabuse
tc19_shadowmem
tc20_verifywrap
tc21_pthonce
tc22_exit_w_lock
tc23_bogus_condwait
tc24_nonzero_sem
thread_name
trylock
tsan_unittest
unit_bitmap
unit_vc
vg_regtest.tmp*
Modified: trunk/drd/tests/Makefile.am
===================================================================
--- trunk/drd/tests/Makefile.am 2009-08-11 14:45:03 UTC (rev 10778)
+++ trunk/drd/tests/Makefile.am 2009-08-11 15:00:54 UTC (rev 10779)
@@ -25,6 +25,8 @@
annotate_rwlock.vgtest \
annotate_ignore_read.stderr.exp \
annotate_ignore_read.vgtest \
+ annotate_ignore_rw.stderr.exp \
+ annotate_ignore_rw.vgtest \
annotate_trace_memory.stderr.exp \
annotate_trace_memory.vgtest \
atomic_var.stderr.exp \
@@ -238,6 +240,7 @@
check_PROGRAMS = \
+ annotate_ignore_rw \
custom_alloc \
fp_race \
hold_lock \
Added: trunk/drd/tests/annotate_ignore_rw.c
===================================================================
--- trunk/drd/tests/annotate_ignore_rw.c (rev 0)
+++ trunk/drd/tests/annotate_ignore_rw.c 2009-08-11 15:00:54 UTC (rev 10779)
@@ -0,0 +1,50 @@
+/* Test program for the annotations that suppress both reads and writes. */
+
+#include <assert.h> /* assert() */
+#include <pthread.h>
+#include <stdio.h> /* EOF */
+#include <unistd.h> /* getopt() */
+#include "../../drd/drd.h"
+
+static int s_a;
+static int s_b;
+
+static void* thread_func(void* arg)
+{
+ /* Read s_a and modify s_b. */
+ s_b = s_a;
+
+ return NULL;
+}
+
+int main(int argc, char** argv)
+{
+ int optchar;
+ int ign_rw = 1;
+ pthread_t tid;
+
+ while ((optchar = getopt(argc, argv, "r")) != EOF)
+ {
+ switch (optchar)
+ {
+ case 'r':
+ ign_rw = 0;
+ break;
+ default:
+ assert(0);
+ }
+ }
+
+ pthread_create(&tid, 0, thread_func, 0);
+ if (ign_rw)
+ ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN();
+ /* Read s_b and modify s_a. */
+ s_a = s_b;
+ if (ign_rw)
+ ANNOTATE_IGNORE_READS_AND_WRITES_END();
+ pthread_join(tid, 0);
+
+ fprintf(stderr, "Finished.\n");
+
+ return 0;
+}
Added: trunk/drd/tests/annotate_ignore_rw.stderr.exp
===================================================================
--- trunk/drd/tests/annotate_ignore_rw.stderr.exp (rev 0)
+++ trunk/drd/tests/annotate_ignore_rw.stderr.exp 2009-08-11 15:00:54 UTC (rev 10779)
@@ -0,0 +1,4 @@
+
+Finished.
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Added: trunk/drd/tests/annotate_ignore_rw.vgtest
===================================================================
--- trunk/drd/tests/annotate_ignore_rw.vgtest (rev 0)
+++ trunk/drd/tests/annotate_ignore_rw.vgtest 2009-08-11 15:00:54 UTC (rev 10779)
@@ -0,0 +1,4 @@
+prereq: ./supported_libpthread
+vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no
+prog: annotate_ignore_rw
+stderr_filter: filter_stderr
Added: trunk/drd/tests/annotate_ignore_rw2.stderr.exp
===================================================================
--- trunk/drd/tests/annotate_ignore_rw2.stderr.exp (rev 0)
+++ trunk/drd/tests/annotate_ignore_rw2.stderr.exp 2009-08-11 15:00:54 UTC (rev 10779)
@@ -0,0 +1,13 @@
+
+Conflicting load by thread 1 at 0x........ size 4
+ at 0x........: main (annotate_ignore_rw.c:?)
+Location 0x........ is 0 bytes inside local var "s_b"
+declared at annotate_ignore_rw.c:10, in frame #? of thread 1
+
+Conflicting store by thread 1 at 0x........ size 4
+ at 0x........: main (annotate_ignore_rw.c:?)
+Location 0x........ is 0 bytes inside local var "s_a"
+declared at annotate_ignore_rw.c:9, in frame #? of thread 1
+Finished.
+
+ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Added: trunk/drd/tests/annotate_ignore_rw2.vgtest
===================================================================
--- trunk/drd/tests/annotate_ignore_rw2.vgtest (rev 0)
+++ trunk/drd/tests/annotate_ignore_rw2.vgtest 2009-08-11 15:00:54 UTC (rev 10779)
@@ -0,0 +1,5 @@
+prereq: ./supported_libpthread
+vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no
+prog: annotate_ignore_rw
+args: -r
+stderr_filter: filter_stderr
|