diff options
author | mickey <> | 2003-02-12 06:49:04 +0000 |
---|---|---|
committer | mickey <> | 2003-02-12 06:49:04 +0000 |
commit | df50f5d5668c1dd3920be8a8c09c8bbd00f223cd (patch) | |
tree | 7d984833982a6c3230cf0317c9b1f313c2a2a648 | |
parent | 240aed806834cc514ea7fc38b7d2bc36e60f9b78 (diff) | |
download | openbsd-df50f5d5668c1dd3920be8a8c09c8bbd00f223cd.tar.gz openbsd-df50f5d5668c1dd3920be8a8c09c8bbd00f223cd.tar.bz2 openbsd-df50f5d5668c1dd3920be8a8c09c8bbd00f223cd.zip |
simple alloca test. done twice per deraadt@ suggest
Diffstat (limited to '')
-rw-r--r-- | src/regress/lib/libc/Makefile | 3 | ||||
-rw-r--r-- | src/regress/lib/libc/alloca/Makefile | 5 | ||||
-rw-r--r-- | src/regress/lib/libc/alloca/alloca.c | 19 |
3 files changed, 26 insertions, 1 deletions
diff --git a/src/regress/lib/libc/Makefile b/src/regress/lib/libc/Makefile index d383b58371..e8c5809eb6 100644 --- a/src/regress/lib/libc/Makefile +++ b/src/regress/lib/libc/Makefile | |||
@@ -1,5 +1,6 @@ | |||
1 | # $OpenBSD: Makefile,v 1.9 2002/08/30 07:58:08 dhartmei Exp $ | 1 | # $OpenBSD: Makefile,v 1.10 2003/02/12 06:49:04 mickey Exp $ |
2 | 2 | ||
3 | SUBDIR+= alloca | ||
3 | SUBDIR+= _setjmp db getaddrinfo regex setjmp sigsetjmp malloc sigreturn popen | 4 | SUBDIR+= _setjmp db getaddrinfo regex setjmp sigsetjmp malloc sigreturn popen |
4 | SUBDIR+= longjmp atexit | 5 | SUBDIR+= longjmp atexit |
5 | .if (${MACHINE_ARCH} != "vax") | 6 | .if (${MACHINE_ARCH} != "vax") |
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 | |||
3 | PROG= 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 | |||
7 | int | ||
8 | main() | ||
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 | } | ||