diff options
-rw-r--r-- | regress/lib/libc/Makefile | 3 | ||||
-rw-r--r-- | regress/lib/libc/alloca/Makefile | 5 | ||||
-rw-r--r-- | regress/lib/libc/alloca/alloca.c | 19 |
3 files changed, 26 insertions, 1 deletions
diff --git a/regress/lib/libc/Makefile b/regress/lib/libc/Makefile index d383b58371b..e8c5809eb6f 100644 --- a/regress/lib/libc/Makefile +++ b/regress/lib/libc/Makefile @@ -1,5 +1,6 @@ -# $OpenBSD: Makefile,v 1.9 2002/08/30 07:58:08 dhartmei Exp $ +# $OpenBSD: Makefile,v 1.10 2003/02/12 06:49:04 mickey Exp $ +SUBDIR+= alloca SUBDIR+= _setjmp db getaddrinfo regex setjmp sigsetjmp malloc sigreturn popen SUBDIR+= longjmp atexit .if (${MACHINE_ARCH} != "vax") diff --git a/regress/lib/libc/alloca/Makefile b/regress/lib/libc/alloca/Makefile new file mode 100644 index 00000000000..f31417cda79 --- /dev/null +++ b/regress/lib/libc/alloca/Makefile @@ -0,0 +1,5 @@ +# $OpenBSD: Makefile,v 1.1 2003/02/12 06:49:04 mickey Exp $ + +PROG= alloca + +.include <bsd.regress.mk> diff --git a/regress/lib/libc/alloca/alloca.c b/regress/lib/libc/alloca/alloca.c new file mode 100644 index 00000000000..4f1f18396a1 --- /dev/null +++ b/regress/lib/libc/alloca/alloca.c @@ -0,0 +1,19 @@ +/* $OpeBSD$ */ + +/* Copyright (c) 2003 Michael Shalayeff. Public Domain. */ + +#include <stdio.h> + +int +main() +{ + char *q, *p; + + p = alloca(41); + strcpy(p, "hellow world"); + + q = alloca(53); + strcpy(q, "hellow world"); + + exit(strcmp(p, q)); +} |