| 1 |
# This file is part of GNU cflow testsuite. -*- Autotest -*- |
| 2 |
# Copyright (C) 2005-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([included symbols]) |
| 18 |
AT_KEYWORDS([include]) |
| 19 |
|
| 20 |
AT_DATA([prog],[ |
| 21 |
int a; |
| 22 |
long _b; |
| 23 |
static int c; |
| 24 |
|
| 25 |
static void |
| 26 |
_bar(int x) |
| 27 |
{ |
| 28 |
a = x; |
| 29 |
} |
| 30 |
|
| 31 |
int |
| 32 |
foo(int y) |
| 33 |
{ |
| 34 |
_b = y; |
| 35 |
c = y; |
| 36 |
_bar(); |
| 37 |
return 1; |
| 38 |
} |
| 39 |
|
| 40 |
int |
| 41 |
main() |
| 42 |
{ |
| 43 |
static int d = foo(2); |
| 44 |
return d; |
| 45 |
} |
| 46 |
]) |
| 47 |
|
| 48 |
CFLOW_OPT([-v],[ |
| 49 |
CFLOW_CHECK_PROG([prog], |
| 50 |
[main() <int main () at prog:22>: |
| 51 |
foo() <int foo (int y) at prog:13>: |
| 52 |
])]) |
| 53 |
|
| 54 |
CFLOW_OPT([-v -i_],[ |
| 55 |
CFLOW_CHECK_PROG([prog], |
| 56 |
[main() <int main () at prog:22>: |
| 57 |
foo() <int foo (int y) at prog:13>: |
| 58 |
_bar() <void _bar (int x) at prog:7>: |
| 59 |
])]) |
| 60 |
|
| 61 |
CFLOW_OPT([-v -ix],[ |
| 62 |
CFLOW_CHECK_PROG([prog], |
| 63 |
[main() <int main () at prog:22>: |
| 64 |
foo() <int foo (int y) at prog:13>: |
| 65 |
c <int c at prog:4> |
| 66 |
d <int d at prog:24> |
| 67 |
])]) |
| 68 |
|
| 69 |
CFLOW_OPT([-v -ix_],[ |
| 70 |
CFLOW_CHECK_PROG([prog], |
| 71 |
[main() <int main () at prog:22>: |
| 72 |
foo() <int foo (int y) at prog:13>: |
| 73 |
_b <long _b at prog:3> |
| 74 |
c <int c at prog:4> |
| 75 |
_bar() <void _bar (int x) at prog:7>: |
| 76 |
a <int a at prog:2> |
| 77 |
d <int d at prog:24> |
| 78 |
])]) |
| 79 |
|
| 80 |
CFLOW_OPT([-v -ix_ -i^s],[ |
| 81 |
CFLOW_CHECK_PROG([prog], |
| 82 |
[main() <int main () at prog:22>: |
| 83 |
foo() <int foo (int y) at prog:13>: |
| 84 |
_b <long _b at prog:3> |
| 85 |
])]) |
| 86 |
|
| 87 |
AT_CLEANUP |