|
From: <sv...@va...> - 2011-03-09 17:50:46
|
Author: bart
Date: 2011-03-09 17:50:34 +0000 (Wed, 09 Mar 2011)
New Revision: 11613
Log:
DRD: Added a regression test.
Added:
trunk/drd/tests/pth_detached3.c
trunk/drd/tests/pth_detached3.stderr.exp
trunk/drd/tests/pth_detached3.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_barrier
annotate_hb_err
annotate_hb_race
annotate_ignore_rw
annotate_ignore_write
annotate_publish_hg
annotate_rwlock
annotate_smart_pointer
annotate_static
atomic_var
bar_bad
bar_trivial
boost_thread
bug-235681
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
pth_uninitialized_cond
qt4_atomic
qt4_mutex
qt4_rwlock
qt4_semaphore
read_after_free
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
threaded-fork
thread_name
trylock
tsan_unittest
unit_bitmap
unit_vc
vg_regtest.tmp*
+ *.dSYM
*.stderr.diff*
*.stderr.out
*.stdout.diff*
*.stdout.out
.deps
Makefile
Makefile.in
annotate_barrier
annotate_hb_err
annotate_hb_race
annotate_ignore_rw
annotate_ignore_write
annotate_publish_hg
annotate_rwlock
annotate_smart_pointer
annotate_static
atomic_var
bar_bad
bar_trivial
boost_thread
bug-235681
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
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_detached3
pth_detached_sem
pth_inconsistent_cond_wait
pth_mutex_reinit
pth_process_shared_mutex
pth_spinlock
pth_uninitialized_cond
qt4_atomic
qt4_mutex
qt4_rwlock
qt4_semaphore
read_after_free
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
threaded-fork
trylock
tsan_unittest
unit_bitmap
unit_vc
vg_regtest.tmp*
Modified: trunk/drd/tests/Makefile.am
===================================================================
--- trunk/drd/tests/Makefile.am 2011-03-08 18:34:44 UTC (rev 11612)
+++ trunk/drd/tests/Makefile.am 2011-03-09 17:50:34 UTC (rev 11613)
@@ -146,6 +146,8 @@
pth_detached2.stderr.exp \
pth_detached2.stdout.exp \
pth_detached2.vgtest \
+ pth_detached3.stderr.exp \
+ pth_detached3.vgtest \
pth_detached_sem.stderr.exp \
pth_detached_sem.stdout.exp \
pth_detached_sem.vgtest \
@@ -285,6 +287,7 @@
pth_create_chain \
pth_detached \
pth_detached_sem \
+ pth_detached3 \
pth_inconsistent_cond_wait \
pth_mutex_reinit \
pth_process_shared_mutex \
Added: trunk/drd/tests/pth_detached3.c
===================================================================
--- trunk/drd/tests/pth_detached3.c (rev 0)
+++ trunk/drd/tests/pth_detached3.c 2011-03-09 17:50:34 UTC (rev 11613)
@@ -0,0 +1,29 @@
+/* Invoke pthread_detach() with an invalid thread ID. */
+
+#include <assert.h>
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+
+static void* thread_func(void* arg)
+{
+ return 0;
+}
+
+int main(int argc, char** argv)
+{
+ pthread_t thread;
+
+ pthread_create(&thread, NULL, thread_func, NULL);
+ pthread_join(thread, NULL);
+
+ /* Invoke pthread_detach() with the thread ID of a joined thread. */
+ pthread_detach(thread);
+
+ /* Invoke pthread_detach() with an invalid thread ID. */
+ pthread_detach(thread + 1);
+
+ fprintf(stderr, "Finished.\n");
+
+ return 0;
+}
Added: trunk/drd/tests/pth_detached3.stderr.exp
===================================================================
--- trunk/drd/tests/pth_detached3.stderr.exp (rev 0)
+++ trunk/drd/tests/pth_detached3.stderr.exp 2011-03-09 17:50:34 UTC (rev 11613)
@@ -0,0 +1,12 @@
+
+pthread_detach(): invalid thread ID 0x........
+ at 0x........: pthread_detach (drd_pthread_intercepts.c:?)
+ by 0x........: main (pth_detached3.c:21)
+
+pthread_detach(): invalid thread ID 0x........
+ at 0x........: pthread_detach (drd_pthread_intercepts.c:?)
+ by 0x........: main (pth_detached3.c:24)
+
+Finished.
+
+ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Added: trunk/drd/tests/pth_detached3.vgtest
===================================================================
--- trunk/drd/tests/pth_detached3.vgtest (rev 0)
+++ trunk/drd/tests/pth_detached3.vgtest 2011-03-09 17:50:34 UTC (rev 11613)
@@ -0,0 +1,2 @@
+prereq: ./supported_libpthread
+prog: pth_detached3
|