diff options
author | 2003-02-12 06:49:04 +0000 | |
---|---|---|
committer | 2003-02-12 06:49:04 +0000 | |
commit | db95e364a183d31d983ec511e129b6eb7e84255a (patch) | |
tree | e2b91a9189a52131eb1a353b76fd4e95e6559d0c /regress/lib/libc | |
parent | Kill more commons in sparc64 code (diff) | |
download | wireguard-openbsd-db95e364a183d31d983ec511e129b6eb7e84255a.tar.xz wireguard-openbsd-db95e364a183d31d983ec511e129b6eb7e84255a.zip |
simple alloca test. done twice per deraadt@ suggest
Diffstat (limited to 'regress/lib/libc')
-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)); +} |