-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: simplify
jmpif
s by reversing branches if condition is negated (…
…#5891) Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
- Loading branch information
1 parent
30f8378
commit ba7a568
Showing
4 changed files
with
127 additions
and
1 deletion.
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
6 changes: 6 additions & 0 deletions
6
test_programs/execution_success/negated_jmpif_condition/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,6 @@ | ||
[package] | ||
name = "negated_jmpif_condition" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
test_programs/execution_success/negated_jmpif_condition/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 = "2" |
9 changes: 9 additions & 0 deletions
9
test_programs/execution_success/negated_jmpif_condition/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,9 @@ | ||
fn main(mut x: Field) { | ||
let mut q = 0; | ||
|
||
if x != 10 { | ||
q = 2; | ||
} | ||
|
||
assert(q == 2); | ||
} |