Skip to content

Commit

Permalink
Snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
FTRobbin committed Feb 7, 2025
1 parent c0c4951 commit be4a9be
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/snapshots/files__gamma_condition_and-optimize.snap.new
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: tests/files.rs
assertion_line: 36
expression: visualization.result
---
# ARGS: 1
@main(v0: int) {
c1_: int = const 3;
print c1_;
ret;
}
46 changes: 46 additions & 0 deletions tests/snapshots/files__if_invariant_do_pull_out-optimize.snap.new
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
source: tests/files.rs
assertion_line: 36
expression: visualization.result
---
# ARGS: 20
@unrelated_fn(v0: int): int {
c1_: int = const 4;
v2_: int = div v0 c1_;
ret v2_;
}
@other_unrelated_fn(v0: int): int {
c1_: int = const 3;
v2_: int = mul c1_ v0;
c3_: int = const 5;
v4_: int = div v2_ c3_;
ret v4_;
}
@main(v0: int) {
c1_: int = const 0;
v2_: bool = gt v0 c1_;
v3_: int = abs v0;
c4_: int = const 2;
v5_: int = mul c4_ v3_;
br v2_ .b6_ .b7_;
.b6_:
v8_: int = add v0 v5_;
c9_: int = const 4;
v10_: int = div v0 c9_;
v11_: int = add v10_ v8_;
v12_: int = id v11_;
print v12_;
ret;
jmp .b13_;
.b7_:
c14_: int = const 3;
v15_: int = mul c14_ v0;
c16_: int = const 5;
v17_: int = div v15_ c16_;
v18_: int = sub v17_ v0;
v19_: int = add v18_ v5_;
v12_: int = id v19_;
print v12_;
ret;
.b13_:
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
source: tests/files.rs
assertion_line: 36
expression: visualization.result
---
# ARGS: 20
@unrelated_fn(v0: int, v1: int): int {
c2_: int = const 3;
v3_: int = div v1 c2_;
v4_: int = div v0 v3_;
ret v4_;
}
@other_unrelated_fn(v0: int, v1: int): int {
c2_: int = const 5;
v3_: int = div v0 c2_;
v4_: int = div v1 v3_;
ret v4_;
}
@main(v0: int) {
c1_: int = const 0;
v2_: bool = gt v0 c1_;
v3_: int = abs v0;
c4_: int = const 2;
v5_: int = mul c4_ v3_;
br v2_ .b6_ .b7_;
.b6_:
c8_: int = const 3;
v9_: int = div v5_ c8_;
v10_: int = div v3_ v9_;
v11_: int = id v10_;
print v11_;
ret;
jmp .b12_;
.b7_:
c13_: int = const 5;
v14_: int = div v0 c13_;
v15_: int = div v5_ v14_;
v11_: int = id v15_;
print v11_;
ret;
.b12_:
}

0 comments on commit be4a9be

Please sign in to comment.