-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ssa): Hoist MakeArray instructions during loop invariant code mo…
…tion (noir-lang/noir#6782) feat: add `(x | 1)` optimization for booleans (noir-lang/noir#6795) feat: `nargo test -q` (or `nargo test --format terse`) (noir-lang/noir#6776) fix: disable failure persistance in nargo test fuzzing (noir-lang/noir#6777) feat(cli): Verify `return` against ABI and `Prover.toml` (noir-lang/noir#6765) chore(ssa): Activate loop invariant code motion on ACIR functions (noir-lang/noir#6785) fix: use extension in docs link so it also works on GitHub (noir-lang/noir#6787) fix: optimizer to keep track of changing opcode locations (noir-lang/noir#6781) fix: Minimal change to avoid reverting entire PR #6685 (noir-lang/noir#6778)
- Loading branch information
Showing
24 changed files
with
684 additions
and
193 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0925a332dbaa561aad195c143079588158498dad | ||
b88db67a4fa92f861329105fb732a7b1309620fe |
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
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
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
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
noir/noir-repo/test_programs/execution_success/diamond_deps_0/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
x = 1 | ||
y = 1 | ||
return = 5 | ||
return = 7 |
7 changes: 7 additions & 0 deletions
7
noir/noir-repo/test_programs/execution_success/return_twice/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,7 @@ | ||
[package] | ||
name = "return_twice" | ||
version = "0.1.0" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
2 changes: 2 additions & 0 deletions
2
noir/noir-repo/test_programs/execution_success/return_twice/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,2 @@ | ||
return = [100, 100] | ||
in0 = 10 |
5 changes: 5 additions & 0 deletions
5
noir/noir-repo/test_programs/execution_success/return_twice/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,5 @@ | ||
pub fn main(in0: Field) -> pub (Field, Field) { | ||
let out0 = (in0 * in0); | ||
let out1 = (in0 * in0); | ||
(out0, out1) | ||
} |
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
7 changes: 7 additions & 0 deletions
7
noir/noir-repo/test_programs/noir_test_success/assert_message/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,7 @@ | ||
[package] | ||
name = "assert_message" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = ">=0.23.0" | ||
|
||
[dependencies] |
15 changes: 15 additions & 0 deletions
15
noir/noir-repo/test_programs/noir_test_success/assert_message/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,15 @@ | ||
// Have to use inputs otherwise the ACIR gets optimized away due to constants. | ||
// With the original ACIR the optimizations can rearrange or merge opcodes, | ||
// which might end up getting out of sync with assertion messages. | ||
#[test(should_fail_with = "first")] | ||
fn test_assert_message_preserved_during_optimization(a: Field, b: Field, c: Field) { | ||
if (a + b) * (a - b) != c { | ||
assert((a + b) * (a - b) == c, "first"); | ||
assert((a - b) * (a + b) == c, "second"); | ||
assert((a + b) * (a - b) == c, "third"); | ||
assert((2 * a + b) * (a - b / 2) == c * c, "fourth"); | ||
} else { | ||
// The fuzzer might have generated a passing test. | ||
assert((a + b) * (a - b) != c, "first"); | ||
} | ||
} |
7 changes: 5 additions & 2 deletions
7
noir/noir-repo/test_programs/noir_test_success/fuzzer_checks/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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
|
||
#[test(should_fail_with = "42 is not allowed")] | ||
fn finds_magic_value(x: u32) { | ||
let x = x as u64; | ||
assert(2 * x != 42, "42 is not allowed"); | ||
if x == 21 { | ||
assert(2 * x != 42, "42 is not allowed"); | ||
} else { | ||
assert(2 * x == 42, "42 is not allowed"); | ||
} | ||
} |
Oops, something went wrong.