about summary refs log tree commit diff
path: root/nptl/tst-context1.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-04-04 10:52:27 +0000
committerUlrich Drepper <drepper@redhat.com>2004-04-04 10:52:27 +0000
commite6eb894e8d9736ea54f1f546c897fc959beefdfd (patch)
treeee9db065634e2028d781c1995414bef465476d9a /nptl/tst-context1.c
parent53de11add6663a7ea878307ab7be81f48d82310b (diff)
downloadglibc-e6eb894e8d9736ea54f1f546c897fc959beefdfd.tar.gz
glibc-e6eb894e8d9736ea54f1f546c897fc959beefdfd.tar.xz
glibc-e6eb894e8d9736ea54f1f546c897fc959beefdfd.zip
Update.
2004-04-04  Ulrich Drepper  <drepper@redhat.com>

	* tst-context1.c (fct): Check whether correct stack is used.
Diffstat (limited to 'nptl/tst-context1.c')
-rw-r--r--nptl/tst-context1.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/nptl/tst-context1.c b/nptl/tst-context1.c
index ff6e381636..06e432b566 100644
--- a/nptl/tst-context1.c
+++ b/nptl/tst-context1.c
@@ -36,9 +36,23 @@ static volatile int failures;
 static void
 fct (long int n)
 {
+  char on_stack[1];
+
   /* Just to use the thread local descriptor.  */
-  printf ("%ld: in %s now\n", n, __FUNCTION__);
+  printf ("%ld: in %s now, on_stack = %p\n", n, __FUNCTION__, on_stack);
   errno = 0;
+
+  if (n < 0 || n >= N)
+    {
+      printf ("%ld out of range\n", n);
+      exit (1);
+    }
+
+  if (on_stack < stacks[n] || on_stack >= stacks[n] + sizeof (stacks[0]))
+    {
+      printf ("%ld: on_stack not on appropriate stack\n", n);
+      exit (1);
+    }
 }