Skip to content

Commit 07053f4

Browse files
committed
SSA CFG: add test for multi-return non-continuing function
1 parent 2e15230 commit 07053f4

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
function reverter() -> a, b { revert(0, 0) }
3+
// the cfg should reflect that reverter has two output variables although it cannot continue
4+
let x, y := reverter()
5+
sstore(x, y)
6+
}
7+
// ----
8+
// digraph SSACFG {
9+
// nodesep=0.7;
10+
// graph[fontname="DejaVu Sans"]
11+
// node[shape=box,fontname="DejaVu Sans"];
12+
//
13+
// Entry [label="Entry"];
14+
// Entry -> Block0_0;
15+
// Block0_0 [fillcolor="#FF746C", style=filled, label="\
16+
// Block 0; (0, max 0)\nLiveIn: \l\
17+
// LiveOut: \l\nUsed: \l\nv0 := reverter()\l\
18+
// v1 := v0.proj(0)\l\
19+
// v2 := v0.proj(1)\l\
20+
// "];
21+
// Block0_0Exit [label="Terminated"];
22+
// Block0_0 -> Block0_0Exit;
23+
// FunctionEntry_reverter_0 [label="function reverter:
24+
// [2 returns] := reverter()"];
25+
// FunctionEntry_reverter_0 -> Block1_0;
26+
// Block1_0 [fillcolor="#FF746C", style=filled, label="\
27+
// Block 0; (0, max 0)\nLiveIn: \l\
28+
// LiveOut: \l\nUsed: \l\nrevert(0x00, 0x00)\l\
29+
// "];
30+
// Block1_0Exit [label="Terminated"];
31+
// Block1_0 -> Block1_0Exit;
32+
// }

0 commit comments

Comments
 (0)