Debian Codegraph @

tests/knr.at

raw
1 # This file is part of GNU cflow testsuite. -*- Autotest -*-
2 # Copyright (C) 2006-2025 Sergey Poznyakoff
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 AT_SETUP([K&R style function declarations])
18 AT_KEYWORDS([knr])
19
20 # Cflow versions 1.0 and 1.1 improperly handled K&R style declarations.
21 # Reported by: "Robert E. Michael" <[email protected]>
22 # References: <[email protected]>
23
24 CFLOW_CHECK([
25 main(argc, argv)
26 int argc;
27 char *argv[]
28 {
29 foo(argc);
30 }
31
32 void
33 foo(x)
34 TYPE x;
35 {
36 x;
37 }
38 ],
39 [main() <main (argc, argv) at prog:2>:
40 foo() <void foo (x) at prog:10>
41 ])
42
43 AT_CLEANUP
44