File tree Expand file tree Collapse file tree 24 files changed +172
-80
lines changed
goto-analyze-show-goto-functions
simplify-fp-dynamic-array-fp
simplify-fp-modified-array-pointer-fp
simplify-fp-modified-array
simplify-fp-non-const-pointer
simplify-fp-variable-array
simplify-fp-modified-array-pointer-fp
simplify-fp-modified-array
simplify-fp-non-const-pointer Expand file tree Collapse file tree 24 files changed +172
-80
lines changed Original file line number Diff line number Diff line change 1+
2+ default : tests.log
3+
4+ test :
5+ @if ! ../test.pl -c ../chain.sh ; then \
6+ ../failed-tests-printer.pl ; \
7+ exit 1; \
8+ fi
9+
10+ tests.log :
11+ @if ! ../test.pl -c ../chain.sh ; then \
12+ ../failed-tests-printer.pl ; \
13+ exit 1; \
14+ fi
15+
16+ show :
17+ @for dir in * ; do \
18+ if [ -d " $$ dir" ]; then \
19+ vim -o " $$ dir/*.c" " $$ dir/*.out" ; \
20+ fi ; \
21+ done ;
22+
23+ clean :
24+ @for dir in * ; do \
25+ rm -f tests.log; \
26+ if [ -d " $$ dir" ]; then \
27+ cd " $$ dir" ; \
28+ rm -f * .out * .gb; \
29+ cd ..; \
30+ fi \
31+ done
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ SRC=../../../src
6+ GA=$SRC /goto-analyzer/goto-analyzer
7+
8+ if [ -a $1 _simplified.gb ]
9+ then
10+ rm $1 _simplified.gb
11+ fi
12+ $GA $1 --simplify $1 _simplified.gb --variable --arrays --structs --pointers
13+ $GA $1 _simplified.gb --show-goto-functions
File renamed without changes.
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+
4+ ^\s*f4\(\);$
5+ ^SIGNAL=0$
6+ --
7+ ^warning: ignoring
8+ ^\s*\d+: f1\(\);$
9+ ^\s*\d+: f2\(\);$
10+ ^\s*\d+: f3\(\);$
11+ ^\s*\d+: f5\(\);$
12+ ^\s*\d+: f6\(\);$
13+ ^\s*\d+: f7\(\);$
14+ ^\s*\d+: f8\(\);$
15+ ^\s*\d+: f9\(\);$
16+ --
17+ Check the simplified goto program doesn't call any of the other functions (i.e
18+ it has simplified all the unused cases generated by function pointer removal)
File renamed without changes.
Original file line number Diff line number Diff line change 11FUTURE
22main.c
3- --simplify out_simplified.gb --variable --arrays --structs --pointers
4- ^Simplified: .* goto: 8
5- ^Unmodified: .* goto: 10
3+
4+ ^\s*f3\(\);$
65^SIGNAL=0$
7- ^EXIT=0$
86--
97^warning: ignoring
8+ ^\s*\d+: f1\(\);$
9+ ^\s*\d+: f2\(\);$
10+ ^\s*\d+: f4\(\);$
11+ ^\s*\d+: f5\(\);$
12+ ^\s*\d+: f6\(\);$
13+ ^\s*\d+: f7\(\);$
14+ ^\s*\d+: f8\(\);$
15+ ^\s*\d+: f9\(\);$
1016--
1117Check the GOTOs generated by the function pointer removal are removed by the
1218simplify step. This requires supporting tracking arrays assigned dynamically
File renamed without changes.
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+
4+ ^SIGNAL=0$
5+ ^\s*f2\(\);$
6+ --
7+ ^warning: ignoring
8+ ^\s*\d+: f1\(\);$
9+ ^\s*\d+: f3\(\);$
10+ ^\s*\d+: f4\(\);$
11+ ^\s*\d+: f5\(\);$
12+ ^\s*\d+: f6\(\);$
13+ ^\s*\d+: f7\(\);$
14+ ^\s*\d+: f8\(\);$
15+ ^\s*\d+: f9\(\);$
16+ --
17+ Check the GOTOs generated by the function pointer removal are removed by the
18+ simplify step.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ FUTURE
2+ main.c
3+
4+ ^SIGNAL=0$
5+ ^\s*f5\(\);$
6+ --
7+ ^warning: ignoring
8+ ^\s*\d+: f1\(\);$
9+ ^\s*\d+: f2\(\);$
10+ ^\s*\d+: f3\(\);$
11+ ^\s*\d+: f4\(\);$
12+ ^\s*\d+: f6\(\);$
13+ ^\s*\d+: f7\(\);$
14+ ^\s*\d+: f8\(\);$
15+ ^\s*\d+: f9\(\);$
16+ --
17+ Check the GOTOs generated by the function pointer removal are removed by the
18+ simplify step
You can’t perform that action at this time.
0 commit comments