summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-02-12 06:49:05 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-02-12 06:49:05 +0000
commit072aa31968bf2b5e98ffb949a44a55f4a9919b2a (patch)
treecdb439ec18f65971590df383e53bb73055642094 /regress
parent57e10100cd9f0e1583d6ee2a24806c79928675a4 (diff)
simple alloca test. done twice per deraadt@ suggest
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libc/Makefile3
-rw-r--r--regress/lib/libc/alloca/Makefile5
-rw-r--r--regress/lib/libc/alloca/alloca.c19
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));
+}