-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Pulls out noir-lang/noir#6461 from the sync PR
- Loading branch information
1 parent
723b77b
commit 21e07d2
Showing
4 changed files
with
203 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
noir/noir-repo/test_programs/execution_success/regression_6451/Nargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[package] | ||
name = "regression_6451" | ||
type = "bin" | ||
authors = [""] | ||
[dependencies] |
1 change: 1 addition & 0 deletions
1
noir/noir-repo/test_programs/execution_success/regression_6451/Prover.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
x = 0 |
23 changes: 23 additions & 0 deletions
23
noir/noir-repo/test_programs/execution_success/regression_6451/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
fn main(x: Field) { | ||
// Regression test for #6451 | ||
let y = unsafe { empty(x) }; | ||
let mut value = 0; | ||
let term1 = x * x - x * y; | ||
std::as_witness(term1); | ||
value += term1; | ||
let term2 = x * x - y * x; | ||
value += term2; | ||
value.assert_max_bit_size::<1>(); | ||
|
||
// Regression test for Aztec Packages issue #6451 | ||
let y = unsafe { empty(x + 1) }; | ||
let z = y + x + 1; | ||
let z1 = z + y; | ||
assert(z + z1 != 3); | ||
let w = y + 2 * x + 3; | ||
assert(w + z1 != z); | ||
} | ||
|
||
unconstrained fn empty(_: Field) -> Field { | ||
0 | ||
} |