diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-12-11 10:24:36 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-12-11 10:24:36 -0500 |
commit | 83f6ad10c7229130f81ff78e3669110e54d4a7ec (patch) | |
tree | cce98b4c6e638b6ff7f9c35c240e679879a61f6e | |
parent | 85014e16e95d0cda3ef192debd4bc79195ee4551 (diff) | |
download | deheader-83f6ad10c7229130f81ff78e3669110e54d4a7ec.tar.gz deheader-83f6ad10c7229130f81ff78e3669110e54d4a7ec.tar.bz2 deheader-83f6ad10c7229130f81ff78e3669110e54d4a7ec.tar.xz deheader-83f6ad10c7229130f81ff78e3669110e54d4a7ec.zip |
Tests for brk(2) and sbrk(2).
-rwxr-xr-x | deheader | 25 | ||||
-rw-r--r-- | test/brk.c | 15 | ||||
-rw-r--r-- | test/regress.chk | 36 | ||||
-rw-r--r-- | test/sbrk.c | 15 |
4 files changed, 64 insertions, 27 deletions
@@ -42,18 +42,19 @@ requirements = map(lambda (r, h): (re.compile(r), h), ( # Headers mandated by SuS that may not be required by a particular compiler, # usually because all the argument types and the return type are composed # from C scalar types. - (r"a64l\s*\(", ["<stdlib.h>"]), - (r"l64a\s*\(", ["<stdlib.h>"]), - (r"access\s*\(", ["<unistd.h>"]), - (r"acos\s*\(", ["<math.h>"]), - (r"acosh\s*\(", ["<math.h>"]), - (r"advance\s*\(", ["<regexp.h>"]), - (r"atan\s*\(", ["<math.h>"]), - (r"atanh\s*\(", ["<math.h>"]), - (r"atan2\s*\(", ["<math.h>"]), - (r"basename\s*\(", ["<libgen.h>"]), - (r"bcmp\s*\(", ["<string.h>"]), - (r"umask\s*\(", ["<sys/stat.h>", "<sys/types.h>"]), + (r"\Wa64l\s*\(", ["<stdlib.h>"]), + (r"\Wl64a\s*\(", ["<stdlib.h>"]), + (r"\Waccess\s*\(", ["<unistd.h>"]), + (r"\Wacos\s*\(", ["<math.h>"]), + (r"\Wacosh\s*\(", ["<math.h>"]), + (r"\Wadvance\s*\(", ["<regexp.h>"]), + (r"\Watan\s*\(", ["<math.h>"]), + (r"\Watanh\s*\(", ["<math.h>"]), + (r"\Watan2\s*\(", ["<math.h>"]), + (r"\Wbasename\s*\(", ["<libgen.h>"]), + (r"\Wbcmp\s*\(", ["<string.h>"]), + (r"\Wbrk\s*\(", ["<unistd.h>"]), + (r"\Wumask\s*\(", ["<sys/stat.h>", "<sys/types.h>"]), # Dependencies observed on systems other than the Linux this was # developed under. (r"<sys/socket.h>", ["<sys/stat.h>", "<sys/types.h>"]), diff --git a/test/brk.c b/test/brk.c new file mode 100644 index 0000000..e13c46b --- /dev/null +++ b/test/brk.c @@ -0,0 +1,15 @@ +/* brk() requires <stdlib.h> */ + +/* + * Items: brk( + * Requires: <unistd.h> + * Standardized-By: SuS + * Detected-by: gcc-4.4.3 + Linux + */ + +#include <unistd.h> + +main(int arg, char **argv) +{ + brk(NULL); +} diff --git a/test/regress.chk b/test/regress.chk index a1ea9c7..1edf712 100644 --- a/test/regress.chk +++ b/test/regress.chk @@ -2,41 +2,44 @@ deheader: test/string.c includes <string.h> deheader: test/duplicate.c includes <stdio.h> deheader: test/duplicate.c includes <stdio.h> deheader: test/duplicate.c has more than one inclusion of <stdio.h> +deheader: test/brk.c has requires <unistd.h> from \Wbrk\s*\( +deheader: test/brk.c includes <unistd.h> deheader: test/asinh.c includes <math.h> -deheader: test/atol.c has requires <stdlib.h> from l64a\s*\( +deheader: test/atol.c has requires <stdlib.h> from \Wl64a\s*\( deheader: test/atol.c includes <stdlib.h> deheader: test/umask.c includes <sys/stat.h> deheader: test/umask.c includes <sys/types.h> -deheader: test/umask.c has requires <sys/stat.h>,<sys/types.h> from umask\s*\( -deheader: test/a64l.c has requires <stdlib.h> from a64l\s*\( +deheader: test/umask.c has requires <sys/stat.h>,<sys/types.h> from \Wumask\s*\( +deheader: test/a64l.c has requires <stdlib.h> from \Wa64l\s*\( deheader: test/a64l.c includes <stdlib.h> -deheader: test/bcmp.c has requires <string.h> from bcmp\s*\( +deheader: test/bcmp.c has requires <string.h> from \Wbcmp\s*\( deheader: test/bcmp.c includes <string.h> deheader: test/bcopy.c includes <string.h> deheader: test/atexit.c includes <stdlib.h> deheader: test/abs.c includes <stdlib.h> -deheader: test/access.c has requires <unistd.h> from access\s*\( +deheader: test/access.c has requires <unistd.h> from \Waccess\s*\( deheader: test/access.c includes <unistd.h> -deheader: test/atoi.c has requires <stdlib.h> from l64a\s*\( +deheader: test/atoi.c has requires <stdlib.h> from \Wl64a\s*\( deheader: test/atoi.c includes <stdlib.h> +deheader: test/sbrk.c includes <unistd.h> deheader: test/alarm.c includes <unistd.h> -deheader: test/acos.c has requires <math.h> from acos\s*\( +deheader: test/acos.c has requires <math.h> from \Wacos\s*\( deheader: test/acos.c includes <math.h> deheader: test/abort.c includes <stdlib.h> -deheader: test/atanh.c has requires <math.h> from atanh\s*\( +deheader: test/atanh.c has requires <math.h> from \Watanh\s*\( deheader: test/atanh.c includes <math.h> -deheader: test/atof.c has requires <stdlib.h> from l64a\s*\( +deheader: test/atof.c has requires <stdlib.h> from \Wl64a\s*\( deheader: test/atof.c includes <stdlib.h> -deheader: test/acosh.c has requires <math.h> from acosh\s*\( +deheader: test/acosh.c has requires <math.h> from \Wacosh\s*\( deheader: test/acosh.c includes <math.h> -deheader: test/atan.c has requires <math.h> from atan\s*\( +deheader: test/atan.c has requires <math.h> from \Watan\s*\( deheader: test/atan.c includes <math.h> -deheader: test/basename.c has requires <libgen.h> from basename\s*\( +deheader: test/basename.c has requires <libgen.h> from \Wbasename\s*\( deheader: test/basename.c includes <libgen.h> deheader: test/asin.c includes <math.h> -deheader: test/advance.c has requires <regexp.h> from advance\s*\( +deheader: test/advance.c has requires <regexp.h> from \Wadvance\s*\( deheader: test/advance.c includes <regexp.h> -deheader: test/atan2.c has requires <math.h> from atan2\s*\( +deheader: test/atan2.c has requires <math.h> from \Watan2\s*\( deheader: test/atan2.c includes <math.h> deheader: in test/advance.c, retaining required '#include <regexp.h>\n' deheader: in test/atof.c, retaining required '#include <stdlib.h>\n' @@ -65,10 +68,13 @@ deheader: in test/atan2.c, retaining required '#include <math.h>\n' deheader: in test/acosh.c, retaining required '#include <math.h>\n' deheader: test/abort.c without <stdlib.h> succeeded. deheader: remove <stdlib.h> from test/abort.c +deheader: in test/brk.c, retaining required '#include <unistd.h>\n' deheader: in test/bcmp.c, retaining required '#include <string.h>\n' deheader: test/abs.c without <stdlib.h> succeeded. deheader: remove <stdlib.h> from test/abs.c deheader: in test/atan.c, retaining required '#include <math.h>\n' deheader: test/atexit.c without <stdlib.h> failed (512). +deheader: test/sbrk.c without <unistd.h> succeeded. +deheader: remove <unistd.h> from test/sbrk.c deheader: in test/acos.c, retaining required '#include <math.h>\n' -deheader: saw 24 files, 25 includes, 8 removed +deheader: saw 26 files, 27 includes, 9 removed diff --git a/test/sbrk.c b/test/sbrk.c new file mode 100644 index 0000000..c8bfca7 --- /dev/null +++ b/test/sbrk.c @@ -0,0 +1,15 @@ +/* sbrk() requires <stdlib.h> */ + +/* + * Items: sbrk( + * Requires: <unistd.h> + * Standardized-By: SuS + * Not-Detected-by: gcc-4.4.3 + Linux + */ + +#include <unistd.h> + +main(int arg, char **argv) +{ + sbrk(23); +} |