mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
Added a regression test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11138
This commit is contained in:
parent
7fadd5510a
commit
66daf93864
@ -159,6 +159,8 @@ EXTRA_DIST = \
|
||||
pth_process_shared_mutex.vgtest \
|
||||
pth_spinlock.stderr.exp \
|
||||
pth_spinlock.vgtest \
|
||||
pth_uninitialized_cond.stderr.exp \
|
||||
pth_uninitialized_cond.vgtest \
|
||||
qt4_atomic.stderr.exp \
|
||||
qt4_atomic.vgtest \
|
||||
qt4_mutex.stderr.exp \
|
||||
@ -280,6 +282,7 @@ check_PROGRAMS = \
|
||||
pth_inconsistent_cond_wait \
|
||||
pth_mutex_reinit \
|
||||
pth_process_shared_mutex \
|
||||
pth_uninitialized_cond \
|
||||
recursive_mutex \
|
||||
rwlock_race \
|
||||
rwlock_test \
|
||||
|
||||
28
drd/tests/pth_uninitialized_cond.c
Normal file
28
drd/tests/pth_uninitialized_cond.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* Test program to verify whether DRD only complains about uninitialized
|
||||
* condition variables for dynamically allocated memory.
|
||||
*/
|
||||
|
||||
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
static pthread_cond_t s_cond1 = PTHREAD_COND_INITIALIZER;
|
||||
static pthread_cond_t s_cond2 = PTHREAD_COND_INITIALIZER;
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
fprintf(stderr, "Statically initialized condition variable.\n");
|
||||
|
||||
pthread_cond_signal(&s_cond1);
|
||||
|
||||
fprintf(stderr, "Uninitialized condition variable.\n");
|
||||
|
||||
*((char*)&s_cond2 + sizeof(s_cond2) - 1) ^= 1;
|
||||
pthread_cond_signal(&s_cond2);
|
||||
|
||||
fprintf(stderr, "Done.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
drd/tests/pth_uninitialized_cond.stderr.exp
Normal file
10
drd/tests/pth_uninitialized_cond.stderr.exp
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
Statically initialized condition variable.
|
||||
Uninitialized condition variable.
|
||||
condition variable has not been initialized: cond 0x........
|
||||
at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
|
||||
by 0x........: main (pth_uninitialized_cond.c:?)
|
||||
|
||||
Done.
|
||||
|
||||
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
|
||||
3
drd/tests/pth_uninitialized_cond.vgtest
Normal file
3
drd/tests/pth_uninitialized_cond.vgtest
Normal file
@ -0,0 +1,3 @@
|
||||
prereq: test -e pth_uninitialized_cond && ./supported_libpthread
|
||||
vgopts: --read-var-info=yes --check-stack-var=yes
|
||||
prog: pth_uninitialized_cond
|
||||
Loading…
x
Reference in New Issue
Block a user