Skip to content

Commit

Permalink
Remove test that now doesn't test anything
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite committed Dec 2, 2024
1 parent e066da7 commit f2d5b88
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions compiler/noirc_evaluator/src/ssa/opt/constant_folding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,62 +1179,6 @@ mod test {
assert_eq!(main.dfg[b1].instructions().len(), 0);
}

#[test]
fn deduplicate_across_non_dominated_blocks() {
let src = "
brillig(inline) fn main f0 {
b0(v0: u32):
v2 = lt u32 1000, v0
jmpif v2 then: b1, else: b2
b1():
v4 = add v0, u32 1
v5 = lt v0, v4
constrain v5 == u1 1
jmp b2()
b2():
v7 = lt u32 1000, v0
jmpif v7 then: b3, else: b4
b3():
v8 = add v0, u32 1
v9 = lt v0, v8
constrain v9 == u1 1
jmp b4()
b4():
return
}
";
let ssa = Ssa::from_str(src).unwrap();

// v4 has been hoisted, although:
// - v5 has not yet been removed since it was encountered earlier in the program
// - v8 hasn't been recognized as a duplicate of v6 yet since they still reference v4 and
// v5 respectively
let expected = "
brillig(inline) fn main f0 {
b0(v0: u32):
v2 = lt u32 1000, v0
v4 = add v0, u32 1
jmpif v2 then: b1, else: b2
b1():
v5 = add v0, u32 1
v6 = lt v0, v5
constrain v6 == u1 1
jmp b2()
b2():
jmpif v2 then: b3, else: b4
b3():
v8 = lt v0, v4
constrain v8 == u1 1
jmp b4()
b4():
return
}
";

let ssa = ssa.fold_constants_using_constraints();
assert_normalized_ssa_equals(ssa, expected);
}

#[test]
fn inlines_brillig_call_without_arguments() {
let src = "
Expand Down

0 comments on commit f2d5b88

Please sign in to comment.