From 909d563a32cd935b02c1d8f8857177e246929874 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 15 Feb 2006 05:30:52 +0000 Subject: import tests from glibc --- test/malloc/tst-valloc.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/malloc/tst-valloc.c (limited to 'test/malloc/tst-valloc.c') diff --git a/test/malloc/tst-valloc.c b/test/malloc/tst-valloc.c new file mode 100644 index 000000000..643a0dda4 --- /dev/null +++ b/test/malloc/tst-valloc.c @@ -0,0 +1,23 @@ +/* Test case by Stephen Tweedie . */ +#include +#include +#include + +int +main (void) +{ + char *p; + int pagesize = getpagesize (); + int i; + + p = valloc (pagesize); + i = (long int) p; + + if ((i & (pagesize-1)) != 0) + { + fprintf (stderr, "Alignment problem: valloc returns %p\n", p); + exit (1); + } + + return 0; +} -- cgit v1.2.3