Added regression test pth_create_glibc_2_0.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9633
This commit is contained in:
Bart Van Assche 2009-04-26 07:14:15 +00:00
parent e9d7ba9595
commit ca8a77d31b
4 changed files with 48 additions and 0 deletions

View File

@ -98,6 +98,8 @@ EXTRA_DIST = \
pth_create_chain.stderr.exp \
pth_create_chain.stderr.exp-ppc \
pth_create_chain.vgtest \
pth_create_glibc_2_0.stderr.exp \
pth_create_glibc_2_0.vgtest \
pth_detached.stderr.exp \
pth_detached.stdout.exp \
pth_detached.vgtest \
@ -234,6 +236,10 @@ if HAVE_PTHREAD_BARRIER
check_PROGRAMS += matinv pth_barrier pth_barrier_race pth_barrier_reinit
endif
if HAVE_PTHREAD_CREATE_GLIBC_2_0
check_PROGRAMS += pth_create_glibc_2_0
endif
if HAVE_PTHREAD_SPINLOCK
check_PROGRAMS += pth_spinlock
endif

View File

@ -0,0 +1,34 @@
/* Test program that invokes pthread_create@GLIBC_2.0(). */
#include <pthread.h>
#include <stdio.h>
extern int pthread_create_glibc_2_0(pthread_t*, const pthread_attr_t*,
void *(*)(void*), void*);
__asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
static void* thread_func(void *arg)
{
fprintf(stderr, "The thread.\n");
return 0;
}
int main(int argc, char** argv)
{
int result;
pthread_t thr;
result = (*pthread_create_glibc_2_0)(&thr, 0, thread_func, 0);
if (result != 0)
{
fprintf(stderr, "pthread_create() failed.\n");
return 1;
}
pthread_join(thr, 0);
fprintf(stderr, "Finished.\n");
return 0;
}

View File

@ -0,0 +1,5 @@
The thread.
Finished.
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

View File

@ -0,0 +1,3 @@
prereq: ./supported_libpthread
vgopts: --var-info=yes --check-stack-var=yes
prog: pth_create_glibc_2_0