about summary refs log tree commit diff
path: root/misc/tst-tsearch.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-09-17 18:23:49 +0000
committerUlrich Drepper <drepper@redhat.com>2003-09-17 18:23:49 +0000
commit06f6ca9019897f5d1799c0ae8d7293ed249c0f97 (patch)
tree9a04e5058de47ce0898cf279205c8e58735efb96 /misc/tst-tsearch.c
parent65af7e61427ce9bbbc0e43b2ad44e5b4678a37fc (diff)
downloadglibc-06f6ca9019897f5d1799c0ae8d7293ed249c0f97.tar.gz
glibc-06f6ca9019897f5d1799c0ae8d7293ed249c0f97.tar.xz
glibc-06f6ca9019897f5d1799c0ae8d7293ed249c0f97.zip
Update.
2003-09-17  Philip Blundell  <philb@gnu.org>

	* sysdeps/unix/sysv/linux/arm/vfork.S: Branch to fork if
	libpthread is loaded.  Elide backwards compatibility code when not
	required.
Diffstat (limited to 'misc/tst-tsearch.c')
-rw-r--r--misc/tst-tsearch.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/misc/tst-tsearch.c b/misc/tst-tsearch.c
index 722b6d7907..66f76ac884 100644
--- a/misc/tst-tsearch.c
+++ b/misc/tst-tsearch.c
@@ -1,5 +1,5 @@
 /* Test program for tsearch et al.
-   Copyright (C) 1997, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <search.h>
+#include <tst-stack-align.h>
 
 #define SEED 0
 #define BALANCED 1
@@ -72,10 +73,14 @@ static int depths[SIZE];
 /* Maximum depth during a tree walk.  */
 static int max_depth;
 
+static int stack_align_check[2];
+
 /* Compare two keys.  */
 static int
 cmp_fn (const void *a, const void *b)
 {
+  if (!stack_align_check[0])
+    stack_align_check[0] = TEST_STACK_ALIGN () ? -1 : 1;
   return *(const int *) a - *(const int *) b;
 }
 
@@ -103,6 +108,9 @@ walk_action (const void *nodep, const VISIT which, const int depth)
 {
   int key = **(int **) nodep;
 
+  if (!stack_align_check[1])
+    stack_align_check[1] = TEST_STACK_ALIGN () ? -1 : 1;
+
   if (depth > max_depth)
     max_depth = depth;
   if (which == leaf || which == preorder)
@@ -329,5 +337,17 @@ main (int argc, char **argv)
       total_error |= error;
     }
 
+  for (i = 0; i < 2; ++i)
+    if (stack_align_check[i] == 0)
+      {
+        printf ("stack alignment check %d not run\n", i);
+        total_error |= 1;
+      }
+    else if (stack_align_check[i] != 1)
+      {
+        printf ("stack insufficiently aligned in check %d\n", i);
+        total_error |= 1;
+      }
+
   return total_error;
 }