forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request diffblue#2053 from owen-jones-diffblue/owen-jones-…
…diffblue/bugfix/make-callgraph-include-uncalled-functions Make directed callgraph include nodes with no edges
- Loading branch information
Showing
7 changed files
with
258 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
|
||
int x; | ||
|
||
void func0() | ||
{ | ||
func0(); | ||
} | ||
|
||
void func1() | ||
{ | ||
x = 1; | ||
} | ||
|
||
void func2() | ||
{ | ||
x = 2; | ||
func3(); | ||
} | ||
|
||
void func3() | ||
{ | ||
x = 3; | ||
} | ||
|
||
void func4(int b) | ||
{ | ||
x = 4; | ||
if(b) | ||
{ | ||
func5(0); | ||
} | ||
} | ||
|
||
void func5(int b) | ||
{ | ||
x = 5; | ||
func4(b); | ||
} | ||
|
||
void func6() | ||
{ | ||
x = 6; | ||
} | ||
|
||
void func7(int b) | ||
{ | ||
x = 7; | ||
if(b) | ||
{ | ||
func8(0); | ||
} | ||
} | ||
|
||
void func8(int b) | ||
{ | ||
x = 8; | ||
func7(b); | ||
} | ||
|
||
void func9() | ||
{ | ||
x = 9; | ||
funca(); | ||
} | ||
|
||
void funca() | ||
{ | ||
x = 10; | ||
func9(); | ||
} | ||
|
||
|
||
|
||
int main() | ||
{ | ||
func1(); | ||
func2(); | ||
func4(1); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CORE | ||
main.c | ||
--call-graph | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^main -> func2$ | ||
^main -> func1$ | ||
^main -> func4$ | ||
^funca -> func9$ | ||
^func9 -> funca$ | ||
^func8 -> func7$ | ||
^func7 -> func8$ | ||
^__CPROVER__start -> __CPROVER_initialize$ | ||
^__CPROVER__start -> main$ | ||
^func2 -> func3$ | ||
^func0 -> func0$ | ||
^func4 -> func5$ | ||
^func5 -> func4$ | ||
-- | ||
^warning: ignoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
|
||
int x; | ||
|
||
void func0() | ||
{ | ||
func0(); | ||
} | ||
|
||
void func1() | ||
{ | ||
x = 1; | ||
} | ||
|
||
void func2() | ||
{ | ||
x = 2; | ||
func3(); | ||
} | ||
|
||
void func3() | ||
{ | ||
x = 3; | ||
} | ||
|
||
void func4(int b) | ||
{ | ||
x = 4; | ||
if(b) | ||
{ | ||
func5(0); | ||
} | ||
} | ||
|
||
void func5(int b) | ||
{ | ||
x = 5; | ||
func4(b); | ||
} | ||
|
||
void func6() | ||
{ | ||
x = 6; | ||
} | ||
|
||
void func7(int b) | ||
{ | ||
x = 7; | ||
if(b) | ||
{ | ||
func8(0); | ||
} | ||
} | ||
|
||
void func8(int b) | ||
{ | ||
x = 8; | ||
func7(b); | ||
} | ||
|
||
void func9() | ||
{ | ||
x = 9; | ||
funca(); | ||
} | ||
|
||
void funca() | ||
{ | ||
x = 10; | ||
func9(); | ||
} | ||
|
||
|
||
|
||
int main() | ||
{ | ||
func1(); | ||
func2(); | ||
func4(1); | ||
|
||
return 0; | ||
} |
20 changes: 20 additions & 0 deletions
20
regression/goto-instrument/reachable-call-graph1/test.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CORE | ||
main.c | ||
--reachable-call-graph | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^main -> func2$ | ||
^main -> func1$ | ||
^main -> func4$ | ||
^__CPROVER__start -> __CPROVER_initialize$ | ||
^__CPROVER__start -> main$ | ||
^func2 -> func3$ | ||
^func4 -> func5$ | ||
^func5 -> func4$ | ||
-- | ||
^funca -> func9$ | ||
^func9 -> funca$ | ||
^func8 -> func7$ | ||
^func7 -> func8$ | ||
^func0 -> func0$ | ||
^warning: ignoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.