Skip to content

Commit

Permalink
eof: Update yulControlFlowGraph tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rodiazet committed Feb 3, 2025
1 parent 402031c commit ea58f7e
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/libyul/yulControlFlowGraph/ambiguous_names.yul
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
function b() {}
}
}
// ====
// bytecodeFormat: legacy
// ----
// digraph CFG {
// nodesep=0.7;
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/yulControlFlowGraph/complex.yul
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
}
pop(f(1,2))
}
// ====
// bytecodeFormat: legacy
// ----
// digraph CFG {
// nodesep=0.7;
Expand Down
67 changes: 67 additions & 0 deletions test/libyul/yulControlFlowGraph/eof/function.yul
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
function f(a, b) -> r {
let x := add(a,b)
r := sub(x,a)
}
function g() {
sstore(0x01, 0x0101)
}
function h(x) {
h(f(x, 0))
g()
}
function i() -> v, w {
v := 0x0202
w := 0x0303
}
let x, y := i()
h(x)
h(y)
}
// ====
// bytecodeFormat: >=EOFv1
// ----
// digraph CFG {
// nodesep=0.7;
// node[shape=box];
//
// Entry [label="Entry"];
// Entry -> Block0;
// Block0 [label="\
// i: [ ] => [ TMP[i, 0] TMP[i, 1] ]\l\
// Assignment(x, y): [ TMP[i, 0] TMP[i, 1] ] => [ x y ]\l\
// h: [ x ] => [ ]\l\
// "];
// Block0Exit [label="Terminated"];
// Block0 -> Block0Exit;
//
// FunctionEntry_f_1 [label="function f(a, b) -> r"];
// FunctionEntry_f_1 -> Block1;
// Block1 [label="\
// add: [ b a ] => [ TMP[add, 0] ]\l\
// Assignment(x): [ TMP[add, 0] ] => [ x ]\l\
// sub: [ a x ] => [ TMP[sub, 0] ]\l\
// Assignment(r): [ TMP[sub, 0] ] => [ r ]\l\
// "];
// Block1Exit [label="FunctionReturn[f]"];
// Block1 -> Block1Exit;
//
// FunctionEntry_h_2 [label="function h(x)"];
// FunctionEntry_h_2 -> Block2;
// Block2 [label="\
// f: [ 0x00 x ] => [ TMP[f, 0] ]\l\
// h: [ TMP[f, 0] ] => [ ]\l\
// "];
// Block2Exit [label="Terminated"];
// Block2 -> Block2Exit;
//
// FunctionEntry_i_3 [label="function i() -> v, w"];
// FunctionEntry_i_3 -> Block3;
// Block3 [label="\
// Assignment(v): [ 0x0202 ] => [ v ]\l\
// Assignment(w): [ 0x0303 ] => [ w ]\l\
// "];
// Block3Exit [label="FunctionReturn[i]"];
// Block3 -> Block3Exit;
//
// }
2 changes: 2 additions & 0 deletions test/libyul/yulControlFlowGraph/function.yul
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
h(x)
h(y)
}
// ====
// bytecodeFormat: legacy
// ----
// digraph CFG {
// nodesep=0.7;
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/yulControlFlowGraph/leave.yul
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

pop(f(0,1))
}
// ====
// bytecodeFormat: legacy
// ----
// digraph CFG {
// nodesep=0.7;
Expand Down

0 comments on commit ea58f7e

Please sign in to comment.