diff options
Diffstat (limited to 'src')
| -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 | } | ||
