From 06f6ca9019897f5d1799c0ae8d7293ed249c0f97 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 17 Sep 2003 18:23:49 +0000 Subject: Update. 2003-09-17 Philip Blundell * sysdeps/unix/sysv/linux/arm/vfork.S: Branch to fork if libpthread is loaded. Elide backwards compatibility code when not required. --- stdlib/Makefile | 1 + stdlib/tst-qsort.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'stdlib') diff --git a/stdlib/Makefile b/stdlib/Makefile index f882a554ef..72633d8290 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -97,6 +97,7 @@ CFLAGS-atexit.c = -DHAVE_DOT_HIDDEN endif CFLAGS-tst-bsearch.c = $(stack-align-test-flags) +CFLAGS-tst-qsort.c = $(stack-align-test-flags) include ../Rules diff --git a/stdlib/tst-qsort.c b/stdlib/tst-qsort.c index f39667b17c..2b26e74d0b 100644 --- a/stdlib/tst-qsort.c +++ b/stdlib/tst-qsort.c @@ -1,17 +1,24 @@ /* Test case by Paul Eggert */ #include #include +#include struct big { char c[4 * 1024]; }; struct big *array; struct big *array_end; +static int align_check; + int compare (void const *a1, void const *b1) { struct big const *a = a1; struct big const *b = b1; + + if (!align_check) + align_check = TEST_STACK_ALIGN () ? -1 : 1; + if (! (array <= a && a < array_end && array <= b && b < array_end)) { @@ -38,5 +45,11 @@ main (int argc, char **argv) qsort (array, array_members, sizeof *array, compare); + if (align_check == -1) + { + puts ("stack not sufficiently aligned"); + exit (EXIT_FAILURE); + } + return 0; } -- cgit 1.4.1