Skip to content

Commit 7837b0a

Browse files
dhoekwatercopybara-github
authored andcommitted
Add testdata for a function with a loop that contains two conditionals
PiperOrigin-RevId: 697019188
1 parent c5c2146 commit 7837b0a

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

propeller/testdata/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ exports_files([
5353
"test_comdat_1.cc",
5454
"test_comdat_2.cc",
5555
"three_branches.protobuf",
56+
"two_conditionals_in_loop.protobuf",
5657
])
5758

5859
# This rule generates a binary with comdat functions.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
## CFG consisting of a function with two conditionals in a small-trip-count
2+
## loop.
3+
## foo
4+
## |
5+
## 15 |
6+
## v
7+
## +----> foo.1
8+
## | |\
9+
## | | \10
10+
## | | \
11+
## | | v
12+
## 10 | 15 | foo.3 --+
13+
## | | / |
14+
## | | / 9 |
15+
## | | / |
16+
## | vv | 1
17+
## +---- foo.2 |
18+
## | |
19+
## 14 | |
20+
## v |
21+
## foo.4 <-------+
22+
23+
cfg {
24+
name: "foo"
25+
function_index: 22
26+
node {
27+
bb_id: 0
28+
size: 10
29+
out_edges {
30+
sink : {
31+
function_index: 22
32+
bb_index: 1
33+
}
34+
weight: 15
35+
kind: BRANCH_OR_FALLTHROUGH
36+
}
37+
}
38+
node {
39+
bb_id: 1
40+
size: 8
41+
out_edges {
42+
sink : {
43+
function_index: 22
44+
bb_index: 2
45+
}
46+
weight: 15
47+
kind: BRANCH_OR_FALLTHROUGH
48+
}
49+
out_edges {
50+
sink : {
51+
function_index: 22
52+
bb_index: 3
53+
}
54+
weight: 10
55+
kind: BRANCH_OR_FALLTHROUGH
56+
}
57+
}
58+
node {
59+
bb_id: 2
60+
size: 4
61+
out_edges {
62+
sink : {
63+
function_index: 22
64+
bb_index: 1
65+
}
66+
weight: 10
67+
kind: BRANCH_OR_FALLTHROUGH
68+
}
69+
out_edges {
70+
sink : {
71+
function_index: 22
72+
bb_index: 4
73+
}
74+
weight: 14
75+
kind: BRANCH_OR_FALLTHROUGH
76+
}
77+
}
78+
node {
79+
bb_id: 3
80+
size: 6
81+
out_edges {
82+
sink : {
83+
function_index: 22
84+
bb_index: 4
85+
}
86+
weight: 1
87+
kind: BRANCH_OR_FALLTHROUGH
88+
}
89+
out_edges {
90+
sink : {
91+
function_index: 22
92+
bb_index: 2
93+
}
94+
weight: 9
95+
kind: BRANCH_OR_FALLTHROUGH
96+
}
97+
}
98+
node {
99+
bb_id: 4
100+
size: 2
101+
}
102+
}

0 commit comments

Comments
 (0)