summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/alloca
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libc/alloca')
-rw-r--r--src/regress/lib/libc/alloca/Makefile5
-rw-r--r--src/regress/lib/libc/alloca/alloca.c19
2 files changed, 24 insertions, 0 deletions
diff --git a/src/regress/lib/libc/alloca/Makefile b/src/regress/lib/libc/alloca/Makefile
new file mode 100644
index 0000000000..f31417cda7
--- /dev/null
+++ b/src/regress/lib/libc/alloca/Makefile
@@ -0,0 +1,5 @@
1# $OpenBSD: Makefile,v 1.1 2003/02/12 06:49:04 mickey Exp $
2
3PROG= alloca
4
5.include <bsd.regress.mk>
diff --git a/src/regress/lib/libc/alloca/alloca.c b/src/regress/lib/libc/alloca/alloca.c
new file mode 100644
index 0000000000..4f1f18396a
--- /dev/null
+++ b/src/regress/lib/libc/alloca/alloca.c
@@ -0,0 +1,19 @@
1/* $OpeBSD$ */
2
3/* Copyright (c) 2003 Michael Shalayeff. Public Domain. */
4
5#include <stdio.h>
6
7int
8main()
9{
10 char *q, *p;
11
12 p = alloca(41);
13 strcpy(p, "hellow world");
14
15 q = alloca(53);
16 strcpy(q, "hellow world");
17
18 exit(strcmp(p, q));
19}