aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-11-03 14:49:35 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-11-03 14:49:35 +0000
commit401469cce508d8efe748461b60cbabfb38267025 (patch)
tree2465c43321792b864bf9ed5329b53cb206457d7a /tests
parent64b518c8d010e9b6df923130e949d843ddab9a01 (diff)
downloadcflow-401469cce508d8efe748461b60cbabfb38267025.tar.gz
cflow-401469cce508d8efe748461b60cbabfb38267025.tar.bz2
New test
Diffstat (limited to 'tests')
-rw-r--r--tests/nfarg.at36
-rw-r--r--tests/nfparg.at31
2 files changed, 67 insertions, 0 deletions
diff --git a/tests/nfarg.at b/tests/nfarg.at
new file mode 100644
index 0000000..e5f0d9f
--- /dev/null
+++ b/tests/nfarg.at
@@ -0,0 +1,36 @@
+# This file is part of GNU cflow testsuite. -*- Autotest -*-
+# Copyright (C) 2005 Sergey Poznyakoff
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+
+# Test for correct handling of nameless function arguments
+# These consitute an error in C. cflow-1.0 coredumped on them.
+# References: <200511031133.jA3BXgB04525@tamacom.com>
+
+# FIXME: Possibly it would be better to flag an error in such case, but
+# cflow is not supposed to be a substitute for cc or lint.
+
+AT_SETUP([Nameless function arguments])
+AT_KEYWORDS([nfarg function arguments])
+
+CFLOW_CHECK([
+int main(int ())
+{
+}
+],
+[main() <int main (int ()) at prog:2>])
+
+AT_CLEANUP
diff --git a/tests/nfparg.at b/tests/nfparg.at
new file mode 100644
index 0000000..e7aee1f
--- /dev/null
+++ b/tests/nfparg.at
@@ -0,0 +1,31 @@
+# This file is part of GNU cflow testsuite. -*- Autotest -*-
+# Copyright (C) 2005 Sergey Poznyakoff
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+
+# Test for correct handling of the nameless function pointer arguments
+
+AT_SETUP([Nameless function pointer arguments])
+AT_KEYWORDS([nfp nfparg function pointer arguments])
+
+CFLOW_CHECK([
+int main(int (*) ())
+{
+}
+],
+[main() <int main (int (*)()) at prog:2>])
+
+AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.