]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added regression test pth_create_glibc_2_0.
authorBart Van Assche <bvanassche@acm.org>
Sun, 26 Apr 2009 07:14:15 +0000 (07:14 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 26 Apr 2009 07:14:15 +0000 (07:14 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9633

drd/tests/Makefile.am
drd/tests/pth_create_glibc_2_0.c [new file with mode: 0644]
drd/tests/pth_create_glibc_2_0.stderr.exp [new file with mode: 0644]
drd/tests/pth_create_glibc_2_0.vgtest [new file with mode: 0644]

index b612b806079b744d8faaca1702e380883de825aa..2c29d73634919f366484f15ecfeab7a16c40127c 100644 (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
diff --git a/drd/tests/pth_create_glibc_2_0.c b/drd/tests/pth_create_glibc_2_0.c
new file mode 100644 (file)
index 0000000..29dd04b
--- /dev/null
@@ -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;
+}
diff --git a/drd/tests/pth_create_glibc_2_0.stderr.exp b/drd/tests/pth_create_glibc_2_0.stderr.exp
new file mode 100644 (file)
index 0000000..e5bd5a8
--- /dev/null
@@ -0,0 +1,5 @@
+
+The thread.
+Finished.
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/drd/tests/pth_create_glibc_2_0.vgtest b/drd/tests/pth_create_glibc_2_0.vgtest
new file mode 100644 (file)
index 0000000..fc1a88b
--- /dev/null
@@ -0,0 +1,3 @@
+prereq: ./supported_libpthread
+vgopts: --var-info=yes --check-stack-var=yes
+prog: pth_create_glibc_2_0