diff options
author | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2004-04-23 21:36:16 +0000 |
---|---|---|
committer | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2004-04-23 21:36:16 +0000 |
commit | f9396fe143405b99de82b6ea84c0eb98b6627380 (patch) | |
tree | 7ff2e6859d36929c777102fc228f4eeb9ce3b47d /regress/gnu/egcs/gcc-bounds | |
parent | ae834b19461bc0784018ab2c201fffe866af2094 (diff) |
Lots more regression tests to test builtins for gcc3 and various icky
corner cases. need to separate gcc2/gcc3 output expectations since
the error formats have diverged.
Diffstat (limited to 'regress/gnu/egcs/gcc-bounds')
65 files changed, 156 insertions, 7 deletions
diff --git a/regress/gnu/egcs/gcc-bounds/Makefile b/regress/gnu/egcs/gcc-bounds/Makefile index 9e9b5faff16..48806f84742 100644 --- a/regress/gnu/egcs/gcc-bounds/Makefile +++ b/regress/gnu/egcs/gcc-bounds/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.4 2003/10/07 22:24:26 avsm Exp $ +# $OpenBSD: Makefile,v 1.5 2004/04/23 21:36:14 avsm Exp $ C_MODULES?= strlcpy strlcat getcwd memcpy fread memcpy declare \ - sscanf vararray md + sscanf vararray md builtins CPP_MODULES?= snprintf sscanf C_STRLCPY= 1 2 3 4 5 6 @@ -10,9 +10,10 @@ C_GETCWD= 1 2 3 4 C_MEMCPY= 1 2 3 4 5 6 C_FREAD= 1 2 3 4 C_DECLARE= 1 2 3 4 5 6 7 8 9 10 11 12 13 -C_SSCANF= 1 2 +C_SSCANF= 1 2 3 4 5 C_VARARRAY= 1 2 C_MD= 1 2 3 4 5 6 +C_BUILTINS= 1 CPP_SNPRINTF= 1 2 3 4 5 CPP_SSCANF= 1 @@ -27,7 +28,7 @@ REGRESS_TARGETS= ${C_TARGETS} ${CPP_TARGETS} . for j in ${C_${i:U}} C_TARGETS+= c-${i}-${j} c-${i}-${j}: - ${TCC} ${TCFLAGS} -o /dev/null ${i}-${j}.c 2>&1 | diff -u - ${.CURDIR}/${i}-${j}.c.exp + ${TCC} ${TCFLAGS} -o /dev/null ${i}-${j}.c 2>&1 | diff -u - ${.CURDIR}/${i}-${j}.c${EXP} . endfor .endfor @@ -35,18 +36,23 @@ c-${i}-${j}: . for j in ${CPP_${i:U}} CPP_TARGETS+= cpp-${i}-${j} cpp-${i}-${j}: - ${TCXX} ${TCXXFLAGS} -o /dev/null ${i}-${j}.cpp 2>&1 | grep -v 'misused' | diff -u - ${.CURDIR}/${i}-${j}.cpp.exp + ${TCXX} ${TCXXFLAGS} -o /dev/null ${i}-${j}.cpp 2>&1 | grep -v 'misused' | diff -u - ${.CURDIR}/${i}-${j}.cpp${EXP} . endfor .endfor generate: .for i in ${C_TARGETS} - -${TCC} ${TCFLAGS} -o /dev/null ${i:C/^c-//g}.c >${i:C/^c-//g}.c.exp 2>&1 + -${TCC} ${TCFLAGS} -o /dev/null ${i:C/^c-//g}.c >${i:C/^c-//g}.c${EXP} 2>&1 .endfor .for i in ${CPP_TARGETS} - -${TCXX} ${TCXXFLAGS} -o /dev/null ${i:C/^cpp-//g}.cpp >${i:C/^cpp-//g}.cpp.exp 2>&1 + -${TCXX} ${TCXXFLAGS} -o /dev/null ${i:C/^cpp-//g}.cpp >${i:C/^cpp-//g}.cpp${EXP} 2>&1 .endfor .PHONY: ${REGRESS_TARGETS} generate regress .include <bsd.regress.mk> +.if defined(USE_GCC3) +EXP= .exp.gcc3 +.else +EXP= .exp +.endif diff --git a/regress/gnu/egcs/gcc-bounds/builtins-1.c b/regress/gnu/egcs/gcc-bounds/builtins-1.c new file mode 100644 index 00000000000..ea5389b5699 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/builtins-1.c @@ -0,0 +1,23 @@ +#include <string.h> +#include <stdio.h> +#include <stdarg.h> + +int +main(int argc, char **argv) +{ + char buf[100]; + char buf2[50]; + va_list l; + FILE *f; + bzero(buf, 200); + memcpy(buf2, buf, sizeof buf); + memcpy(buf2, buf, 105); + memset(buf, 0, 500); + strncat(buf2, "blahblah", 1000); + strncpy(buf2, buf, 1234); + snprintf(buf, 5432, "foo"); + vsnprintf(buf, 2345, "bar", l); + fwrite(buf, 123, 4, f); + return 1; +} + diff --git a/regress/gnu/egcs/gcc-bounds/builtins-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/builtins-1.c.exp.gcc3 new file mode 100644 index 00000000000..624bd882f7f --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/builtins-1.c.exp.gcc3 @@ -0,0 +1,11 @@ +builtins-1.c: In function `main': +builtins-1.c:12: warning: array size (100) smaller than bound length (200) +builtins-1.c:13: warning: array size (50) smaller than bound length (100) +builtins-1.c:14: warning: array size (50) smaller than bound length (105) +builtins-1.c:14: warning: array size (100) smaller than bound length (105) +builtins-1.c:15: warning: array size (100) smaller than bound length (500) +builtins-1.c:16: warning: array size (50) smaller than bound length (1000) +builtins-1.c:17: warning: array size (50) smaller than bound length (1234) +builtins-1.c:18: warning: array size (100) smaller than bound length (5432) +builtins-1.c:19: warning: array size (100) smaller than bound length (2345) +builtins-1.c:20: warning: array size (100) smaller than required length (4 * 123) diff --git a/regress/gnu/egcs/gcc-bounds/declare-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-1.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-1.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/declare-10.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-10.c.exp.gcc3 new file mode 100644 index 00000000000..6e956337f4a --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-10.c.exp.gcc3 @@ -0,0 +1 @@ +declare-10.c:2: error: bound element size argument not an integer type diff --git a/regress/gnu/egcs/gcc-bounds/declare-11.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-11.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-11.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/declare-12.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-12.c.exp.gcc3 new file mode 100644 index 00000000000..b2895b299ec --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-12.c.exp.gcc3 @@ -0,0 +1 @@ +declare-12.c:2: error: bound element size argument not an integer type diff --git a/regress/gnu/egcs/gcc-bounds/declare-13.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-13.c.exp.gcc3 new file mode 100644 index 00000000000..68f3aa069f9 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-13.c.exp.gcc3 @@ -0,0 +1 @@ +declare-13.c:2: warning: `__foo__' is an unrecognized bounded function type diff --git a/regress/gnu/egcs/gcc-bounds/declare-2.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-2.c.exp.gcc3 new file mode 100644 index 00000000000..82938564e75 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-2.c.exp.gcc3 @@ -0,0 +1 @@ +declare-2.c:2: error: bound buffer argument not an array or pointer type diff --git a/regress/gnu/egcs/gcc-bounds/declare-3.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-3.c.exp.gcc3 new file mode 100644 index 00000000000..0446d33276c --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-3.c.exp.gcc3 @@ -0,0 +1 @@ +declare-3.c:2: error: bound length operand number is not an integer constant diff --git a/regress/gnu/egcs/gcc-bounds/declare-4.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-4.c.exp.gcc3 new file mode 100644 index 00000000000..eae8acb01ba --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-4.c.exp.gcc3 @@ -0,0 +1 @@ +declare-4.c:2: warning: `string' bound type only takes 2 parameters diff --git a/regress/gnu/egcs/gcc-bounds/declare-5.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-5.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-5.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/declare-6.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-6.c.exp.gcc3 new file mode 100644 index 00000000000..2860f1b8550 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-6.c.exp.gcc3 @@ -0,0 +1 @@ +declare-6.c:2: error: `minbytes' bound size must be a positive integer value diff --git a/regress/gnu/egcs/gcc-bounds/declare-7.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-7.c.exp.gcc3 new file mode 100644 index 00000000000..dcf1ba02805 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-7.c.exp.gcc3 @@ -0,0 +1 @@ +declare-7.c:2: warning: `minbytes' bound type only takes 2 parameters diff --git a/regress/gnu/egcs/gcc-bounds/declare-8.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-8.c.exp.gcc3 new file mode 100644 index 00000000000..a6ef5bbe1e4 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-8.c.exp.gcc3 @@ -0,0 +1 @@ +declare-8.c:2: error: wrong number of arguments specified for `__bounded__' attribute diff --git a/regress/gnu/egcs/gcc-bounds/declare-9.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/declare-9.c.exp.gcc3 new file mode 100644 index 00000000000..3ab0481a517 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/declare-9.c.exp.gcc3 @@ -0,0 +1 @@ +declare-9.c:2: error: parameter 3 not specified for `size' bounded function diff --git a/regress/gnu/egcs/gcc-bounds/fread-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/fread-1.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/fread-1.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/fread-2.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/fread-2.c.exp.gcc3 new file mode 100644 index 00000000000..f0ead30ae98 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/fread-2.c.exp.gcc3 @@ -0,0 +1,2 @@ +fread-2.c: In function `main': +fread-2.c:6: warning: array size (100) smaller than required length (110 * 1) diff --git a/regress/gnu/egcs/gcc-bounds/fread-3.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/fread-3.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/fread-3.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/fread-4.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/fread-4.c.exp.gcc3 new file mode 100644 index 00000000000..64c86839fbc --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/fread-4.c.exp.gcc3 @@ -0,0 +1,2 @@ +fread-4.c: In function `main': +fread-4.c:6: warning: array size (100) smaller than required length (100 * 4) diff --git a/regress/gnu/egcs/gcc-bounds/getcwd-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/getcwd-1.c.exp.gcc3 new file mode 100644 index 00000000000..fd2af53199d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/getcwd-1.c.exp.gcc3 @@ -0,0 +1,2 @@ +getcwd-1.c: In function `main': +getcwd-1.c:5: warning: array size (10) is smaller than minimum required (1024) diff --git a/regress/gnu/egcs/gcc-bounds/getcwd-2.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/getcwd-2.c.exp.gcc3 new file mode 100644 index 00000000000..a8e8067f53c --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/getcwd-2.c.exp.gcc3 @@ -0,0 +1,3 @@ +getcwd-2.c: In function `main': +getcwd-2.c:5: warning: array size (10) is smaller than minimum required (1024) +getcwd-2.c:5: warning: non-positive bounds length (-990) detected diff --git a/regress/gnu/egcs/gcc-bounds/getcwd-3.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/getcwd-3.c.exp.gcc3 new file mode 100644 index 00000000000..f84544261c7 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/getcwd-3.c.exp.gcc3 @@ -0,0 +1,3 @@ +getcwd-3.c: In function `main': +getcwd-3.c:5: warning: array size (10) is smaller than minimum required (1024) +getcwd-3.c:5: warning: array size (10) smaller than bound length (2010) diff --git a/regress/gnu/egcs/gcc-bounds/getcwd-4.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/getcwd-4.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/getcwd-4.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/md-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/md-1.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/md-1.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/md-2.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/md-2.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/md-2.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/md-3.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/md-3.c.exp.gcc3 new file mode 100644 index 00000000000..f3797804127 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/md-3.c.exp.gcc3 @@ -0,0 +1,2 @@ +md-3.c: In function `main': +md-3.c:16: warning: sizeof(pointer) possibly incorrect in argument 2 diff --git a/regress/gnu/egcs/gcc-bounds/md-4.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/md-4.c.exp.gcc3 new file mode 100644 index 00000000000..8229028502f --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/md-4.c.exp.gcc3 @@ -0,0 +1,2 @@ +md-4.c: In function `main': +md-4.c:15: warning: array size (10) is smaller than minimum required (33) diff --git a/regress/gnu/egcs/gcc-bounds/md-5.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/md-5.c.exp.gcc3 new file mode 100644 index 00000000000..9f3e82cae73 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/md-5.c.exp.gcc3 @@ -0,0 +1,3 @@ +md-5.c: In function `main': +md-5.c:16: warning: array size (32) is smaller than minimum required (41) +md-5.c:16: warning: sizeof(pointer) possibly incorrect in argument 2 diff --git a/regress/gnu/egcs/gcc-bounds/md-6.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/md-6.c.exp.gcc3 new file mode 100644 index 00000000000..c0dcb0c10f8 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/md-6.c.exp.gcc3 @@ -0,0 +1,2 @@ +md-6.c: In function `main': +md-6.c:15: warning: array size (20) is smaller than minimum required (41) diff --git a/regress/gnu/egcs/gcc-bounds/memcpy-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/memcpy-1.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/memcpy-1.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/memcpy-2.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/memcpy-2.c.exp.gcc3 new file mode 100644 index 00000000000..894e28a9cc9 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/memcpy-2.c.exp.gcc3 @@ -0,0 +1,2 @@ +memcpy-2.c: In function `main': +memcpy-2.c:6: warning: array size (8) smaller than bound length (10) diff --git a/regress/gnu/egcs/gcc-bounds/memcpy-3.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/memcpy-3.c.exp.gcc3 new file mode 100644 index 00000000000..fa29cd78289 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/memcpy-3.c.exp.gcc3 @@ -0,0 +1,2 @@ +memcpy-3.c: In function `main': +memcpy-3.c:6: warning: array size (4) smaller than bound length (8) diff --git a/regress/gnu/egcs/gcc-bounds/memcpy-4.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/memcpy-4.c.exp.gcc3 new file mode 100644 index 00000000000..3165fe55a0e --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/memcpy-4.c.exp.gcc3 @@ -0,0 +1,3 @@ +memcpy-4.c: In function `main': +memcpy-4.c:6: warning: non-positive bounds length (-100) detected +memcpy-4.c:6: warning: non-positive bounds length (-100) detected diff --git a/regress/gnu/egcs/gcc-bounds/memcpy-5.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/memcpy-5.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/memcpy-5.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/memcpy-6.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/memcpy-6.c.exp.gcc3 new file mode 100644 index 00000000000..28c8da74cb4 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/memcpy-6.c.exp.gcc3 @@ -0,0 +1,2 @@ +memcpy-6.c: In function `main': +memcpy-6.c:6: warning: array size (32) smaller than bound length (40) diff --git a/regress/gnu/egcs/gcc-bounds/memcpy-7.c b/regress/gnu/egcs/gcc-bounds/memcpy-7.c new file mode 100644 index 00000000000..d0990649439 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/memcpy-7.c @@ -0,0 +1,9 @@ +#include <string.h> + +extern char buf[]; + +int main(int argc, char **argv) { + char buf2[10] = "123456789"; + memcpy(buf, buf2, sizeof buf2); + return 1; +} diff --git a/regress/gnu/egcs/gcc-bounds/snprintf-1.cpp.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/snprintf-1.cpp.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/snprintf-1.cpp.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/snprintf-2.cpp.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/snprintf-2.cpp.exp.gcc3 new file mode 100644 index 00000000000..3e034bd001e --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/snprintf-2.cpp.exp.gcc3 @@ -0,0 +1,2 @@ +snprintf-2.cpp: In function `int main(int, char**)': +snprintf-2.cpp:5: warning: array size (20) smaller than bound length (30) diff --git a/regress/gnu/egcs/gcc-bounds/snprintf-3.cpp.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/snprintf-3.cpp.exp.gcc3 new file mode 100644 index 00000000000..02f0a3b0fdb --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/snprintf-3.cpp.exp.gcc3 @@ -0,0 +1,2 @@ +snprintf-3.cpp: In function `int main(int, char**)': +snprintf-3.cpp:5: warning: sizeof(pointer) possibly incorrect in argument 2 diff --git a/regress/gnu/egcs/gcc-bounds/snprintf-4.cpp.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/snprintf-4.cpp.exp.gcc3 new file mode 100644 index 00000000000..346e3936ef5 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/snprintf-4.cpp.exp.gcc3 @@ -0,0 +1,3 @@ +snprintf-4.cpp: In function `int main(int, char**)': +snprintf-4.cpp:6: warning: sizeof(pointer) possibly incorrect in argument 2 +snprintf-4.cpp:6: warning: array size (10) smaller than bound length (92) diff --git a/regress/gnu/egcs/gcc-bounds/snprintf-5.cpp.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/snprintf-5.cpp.exp.gcc3 new file mode 100644 index 00000000000..8abe14003fb --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/snprintf-5.cpp.exp.gcc3 @@ -0,0 +1,2 @@ +snprintf-5.cpp: In function `int main(int, char**)': +snprintf-5.cpp:5: warning: non-positive bounds length (-10) detected diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/sscanf-1.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/sscanf-1.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-1.cpp.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/sscanf-1.cpp.exp.gcc3 new file mode 100644 index 00000000000..8b979d48260 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/sscanf-1.cpp.exp.gcc3 @@ -0,0 +1,3 @@ +sscanf-1.cpp: In function `int main(int, char **)': +sscanf-1.cpp:6: warning: Array size (10) smaller than format string size (21) +sscanf-1.cpp:6: warning: Array size (10) smaller than format string size (11) diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-2.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/sscanf-2.c.exp.gcc3 new file mode 100644 index 00000000000..eeb4a57d89c --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/sscanf-2.c.exp.gcc3 @@ -0,0 +1,3 @@ +sscanf-2.c: In function `main': +sscanf-2.c:6: warning: Array size (10) smaller than format string size (21) +sscanf-2.c:6: warning: Array size (10) smaller than format string size (11) diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-3.c b/regress/gnu/egcs/gcc-bounds/sscanf-3.c new file mode 100644 index 00000000000..455562f459f --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/sscanf-3.c @@ -0,0 +1,9 @@ +#include <stdio.h> + +extern char buf1[]; + +int main(int argc, char **argv) { + char q[10], buf1[10]; + sscanf(q,"%[.0-9]",buf1); + return 1; +} diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-3.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/sscanf-3.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/sscanf-3.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-4.c b/regress/gnu/egcs/gcc-bounds/sscanf-4.c new file mode 100644 index 00000000000..684eb14f116 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/sscanf-4.c @@ -0,0 +1,8 @@ +#include <stdio.h> + +int main(int argc, char **argv) { + char q[10]; + char buf1[10]; + sscanf(q,"%10c",buf1); + return 1; +} diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-4.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/sscanf-4.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/sscanf-4.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-5.c b/regress/gnu/egcs/gcc-bounds/sscanf-5.c new file mode 100644 index 00000000000..8ef13310899 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/sscanf-5.c @@ -0,0 +1,8 @@ +#include <stdio.h> + +int main(int argc, char **argv) { + char q[10]; + char buf1[10]; + sscanf(q,"%20c",buf1); + return 1; +} diff --git a/regress/gnu/egcs/gcc-bounds/sscanf-5.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/sscanf-5.c.exp.gcc3 new file mode 100644 index 00000000000..3571b056ac1 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/sscanf-5.c.exp.gcc3 @@ -0,0 +1,2 @@ +sscanf-5.c: In function `main': +sscanf-5.c:6: warning: Array size (10) smaller than format string size (20) diff --git a/regress/gnu/egcs/gcc-bounds/strlcat-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcat-1.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcat-1.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/strlcat-2.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcat-2.c.exp.gcc3 new file mode 100644 index 00000000000..c809499be80 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcat-2.c.exp.gcc3 @@ -0,0 +1,2 @@ +strlcat-2.c: In function `main': +strlcat-2.c:6: warning: non-positive bounds length (-1) detected diff --git a/regress/gnu/egcs/gcc-bounds/strlcat-3.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcat-3.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcat-3.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/strlcat-4.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcat-4.c.exp.gcc3 new file mode 100644 index 00000000000..668fb008245 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcat-4.c.exp.gcc3 @@ -0,0 +1,2 @@ +strlcat-4.c: In function `main': +strlcat-4.c:6: warning: sizeof(pointer) possibly incorrect in argument 3 diff --git a/regress/gnu/egcs/gcc-bounds/strlcat-5.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcat-5.c.exp.gcc3 new file mode 100644 index 00000000000..64d4324dc26 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcat-5.c.exp.gcc3 @@ -0,0 +1,2 @@ +strlcat-5.c: In function `main': +strlcat-5.c:6: warning: sizeof(pointer) possibly incorrect in argument 3 diff --git a/regress/gnu/egcs/gcc-bounds/strlcat-6.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcat-6.c.exp.gcc3 new file mode 100644 index 00000000000..64aaff0c03f --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcat-6.c.exp.gcc3 @@ -0,0 +1,2 @@ +strlcat-6.c: In function `main': +strlcat-6.c:6: warning: non-positive bounds length (-1) detected diff --git a/regress/gnu/egcs/gcc-bounds/strlcpy-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcpy-1.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcpy-1.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/strlcpy-2.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcpy-2.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcpy-2.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/strlcpy-3.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcpy-3.c.exp.gcc3 new file mode 100644 index 00000000000..881f009ea3c --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcpy-3.c.exp.gcc3 @@ -0,0 +1,2 @@ +strlcpy-3.c: In function `main': +strlcpy-3.c:6: warning: array size (10) smaller than bound length (15) diff --git a/regress/gnu/egcs/gcc-bounds/strlcpy-4.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcpy-4.c.exp.gcc3 new file mode 100644 index 00000000000..7092a8714eb --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcpy-4.c.exp.gcc3 @@ -0,0 +1,2 @@ +strlcpy-4.c: In function `main': +strlcpy-4.c:6: warning: sizeof(pointer) possibly incorrect in argument 3 diff --git a/regress/gnu/egcs/gcc-bounds/strlcpy-5.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcpy-5.c.exp.gcc3 new file mode 100644 index 00000000000..b60e17409de --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcpy-5.c.exp.gcc3 @@ -0,0 +1,2 @@ +strlcpy-5.c: In function `main': +strlcpy-5.c:7: warning: sizeof(pointer) possibly incorrect in argument 3 diff --git a/regress/gnu/egcs/gcc-bounds/strlcpy-6.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/strlcpy-6.c.exp.gcc3 new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/strlcpy-6.c.exp.gcc3 diff --git a/regress/gnu/egcs/gcc-bounds/vararray-1.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/vararray-1.c.exp.gcc3 new file mode 100644 index 00000000000..9629a42d375 --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/vararray-1.c.exp.gcc3 @@ -0,0 +1,2 @@ +vararray-1.c: In function `main': +vararray-1.c:8: warning: ISO C90 forbids variable-size array `sample_buffer' diff --git a/regress/gnu/egcs/gcc-bounds/vararray-2.c.exp.gcc3 b/regress/gnu/egcs/gcc-bounds/vararray-2.c.exp.gcc3 new file mode 100644 index 00000000000..417fec229aa --- /dev/null +++ b/regress/gnu/egcs/gcc-bounds/vararray-2.c.exp.gcc3 @@ -0,0 +1,2 @@ +vararray-2.c: In function `main': +vararray-2.c:5: warning: ISO C90 forbids variable-size array `sample_buffer' |