diff options
Diffstat (limited to 'src/regress/lib/libc/alloca/alloca.c')
-rw-r--r-- | src/regress/lib/libc/alloca/alloca.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/regress/lib/libc/alloca/alloca.c b/src/regress/lib/libc/alloca/alloca.c new file mode 100644 index 0000000000..d9573e2f54 --- /dev/null +++ b/src/regress/lib/libc/alloca/alloca.c | |||
@@ -0,0 +1,21 @@ | |||
1 | /* $OpenBSD: alloca.c,v 1.6 2003/09/02 23:52:16 david Exp $ */ | ||
2 | |||
3 | /* Written by Michael Shalayeff, 2003, Public Domain. */ | ||
4 | |||
5 | #include <stdio.h> | ||
6 | #include <stdlib.h> | ||
7 | #include <string.h> | ||
8 | |||
9 | int | ||
10 | main(int argc, char *argv[]) | ||
11 | { | ||
12 | char *q, *p; | ||
13 | |||
14 | p = alloca(41); | ||
15 | strcpy(p, "hellow world"); | ||
16 | |||
17 | q = alloca(53); | ||
18 | strcpy(q, "hellow world"); | ||
19 | |||
20 | exit(strcmp(p, q)); | ||
21 | } | ||