summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-07-03 14:31:42 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-07-03 14:31:42 +0000
commit301837eca0e4b2482aac1646cb809cc11b666f67 (patch)
tree6e36cda2ab894905038e0bde3a47f50e2ae47fb3
parentcd8f4f67b08d173f5a3ddea04f94686f846d9b8f (diff)
some more regress tests for __bounded__
-rw-r--r--regress/gnu/egcs/gcc-bounds/getcwd-1.c7
-rw-r--r--regress/gnu/egcs/gcc-bounds/getcwd-1.c.exp2
-rw-r--r--regress/gnu/egcs/gcc-bounds/getcwd-2.c7
-rw-r--r--regress/gnu/egcs/gcc-bounds/getcwd-2.c.exp3
-rw-r--r--regress/gnu/egcs/gcc-bounds/getcwd-3.c7
-rw-r--r--regress/gnu/egcs/gcc-bounds/getcwd-3.c.exp3
-rw-r--r--regress/gnu/egcs/gcc-bounds/getcwd-4.c8
-rw-r--r--regress/gnu/egcs/gcc-bounds/getcwd-4.c.exp0
8 files changed, 37 insertions, 0 deletions
diff --git a/regress/gnu/egcs/gcc-bounds/getcwd-1.c b/regress/gnu/egcs/gcc-bounds/getcwd-1.c
new file mode 100644
index 00000000000..9d4d41999cb
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/getcwd-1.c
@@ -0,0 +1,7 @@
+#include <unistd.h>
+
+int main(int argc, char **argv) {
+ char buf[10];
+ getcwd(buf, sizeof buf);
+ return 1;
+}
diff --git a/regress/gnu/egcs/gcc-bounds/getcwd-1.c.exp b/regress/gnu/egcs/gcc-bounds/getcwd-1.c.exp
new file mode 100644
index 00000000000..fd2af53199d
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/getcwd-1.c.exp
@@ -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 b/regress/gnu/egcs/gcc-bounds/getcwd-2.c
new file mode 100644
index 00000000000..bd007c64b11
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/getcwd-2.c
@@ -0,0 +1,7 @@
+#include <unistd.h>
+
+int main(int argc, char **argv) {
+ char buf[10];
+ getcwd(buf, sizeof(buf) - 1000);
+ return 1;
+}
diff --git a/regress/gnu/egcs/gcc-bounds/getcwd-2.c.exp b/regress/gnu/egcs/gcc-bounds/getcwd-2.c.exp
new file mode 100644
index 00000000000..a8e8067f53c
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/getcwd-2.c.exp
@@ -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 b/regress/gnu/egcs/gcc-bounds/getcwd-3.c
new file mode 100644
index 00000000000..da4f733d947
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/getcwd-3.c
@@ -0,0 +1,7 @@
+#include <unistd.h>
+
+int main(int argc, char **argv) {
+ char buf[10];
+ getcwd(buf, sizeof(buf) + 2000);
+ return 1;
+}
diff --git a/regress/gnu/egcs/gcc-bounds/getcwd-3.c.exp b/regress/gnu/egcs/gcc-bounds/getcwd-3.c.exp
new file mode 100644
index 00000000000..f84544261c7
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/getcwd-3.c.exp
@@ -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 b/regress/gnu/egcs/gcc-bounds/getcwd-4.c
new file mode 100644
index 00000000000..81b4798708e
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/getcwd-4.c
@@ -0,0 +1,8 @@
+#include <unistd.h>
+
+int main(int argc, char **argv) {
+ /* XXX - is this worth warning for? right now nothing */
+ char buf[1024];
+ getcwd(buf, 10);
+ return 1;
+}
diff --git a/regress/gnu/egcs/gcc-bounds/getcwd-4.c.exp b/regress/gnu/egcs/gcc-bounds/getcwd-4.c.exp
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/getcwd-4.c.exp