-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a testdata proto for a function call within a loop
PiperOrigin-RevId: 696883638
- Loading branch information
1 parent
b74e784
commit cd89d70
Showing
2 changed files
with
88 additions
and
0 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
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,87 @@ | ||
## CFG consisting of a function calling another function in a simple loop. | ||
## | ||
## foo <------- baz | ||
## | 100 | ||
## 5 | | ||
## | | ||
## v 100 | ||
## +---> foo.1 -------> bar | ||
## | | | ||
## | 100 |100 | ||
## | | | ||
## | v | ||
## +--- foo.2 | ||
## | ||
|
||
cfg { | ||
name: "foo" | ||
function_index: 1 | ||
node { | ||
bb_id: 0 | ||
size: 10 | ||
out_edges { | ||
sink : { | ||
function_index: 1 | ||
bb_index: 1 | ||
} | ||
weight: 5 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 1 | ||
size: 4 | ||
out_edges { | ||
sink : { | ||
function_index: 1 | ||
bb_index: 2 | ||
} | ||
weight: 100 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
out_edges { | ||
sink : { | ||
function_index: 2 | ||
bb_index: 0 | ||
} | ||
weight: 100 | ||
kind: CALL | ||
} | ||
} | ||
node { | ||
bb_id: 2 | ||
size: 6 | ||
out_edges { | ||
sink : { | ||
function_index: 1 | ||
bb_index: 1 | ||
} | ||
weight: 100 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
} | ||
cfg { | ||
name: "bar" | ||
function_index: 2 | ||
node { | ||
bb_id: 0 | ||
size: 2 | ||
} | ||
} | ||
cfg { | ||
name: "baz" | ||
function_index: 3 | ||
node { | ||
bb_id: 0 | ||
size: 6 | ||
out_edges { | ||
sink : { | ||
function_index: 1 | ||
bb_index: 0 | ||
} | ||
weight: 100 | ||
kind: CALL | ||
} | ||
} | ||
} |