-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(brillig): master into brillig main (#1663)
* fix(ssa refactor): resolve replaced value ids for printing (#1535) * fix(ssa refactor): resolve replaced value ids for printing * fix(ssa refactor): Expand PR #1535 to resolve ValueIds in all SSA passes (#1642) * Expand PR * chore(ssa refactor): more value id resolving * chore(ssa refactor): another value id resolve --------- Co-authored-by: Joss <joss@aztecprotocol.com> --------- Co-authored-by: jfecher <jake@aztecprotocol.com> * chore(ssa refactor): enable_side_effects instruction (#1547) * chore(ssa refactor): enable_side_effects instruction * chore(ssa refactor): fix and document enable_side_effects insertions * chore(ssa refactor): rm comments * fix(ssa refactor): redundant EnableSideEffects * chore(ssa refactor): cp working tests (#1619) * chore(ssa gen): ssa gen truncate instruction * chore(ssa refactor): max bit size for subtract * Update crates/noirc_evaluator/src/ssa_refactor/ssa_gen/context.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * chore(ssa refactor): truncate shift left * chore(ssa refactor): Add integer modulus when truncating subtraction * chore(ssa refactor): clippy * chore(ssa refactor): fix left shift max bit size * chore(ssa refactor): cp xor test * chore(ssa refactor): cp working tests * chore(ssa refactor): more working tests * chore(ssa refactor): cp working test --------- Co-authored-by: kevaundray <kevtheappdev@gmail.com> Co-authored-by: jfecher <jake@aztecprotocol.com> * chore(ssa refactor): Remove unit values from SSA IR (#1646) * Remove unit values * Fix test * Fix comment * chore: Upgrade codespan dependencies (#1647) * chore(ssa refactor): Implement dead instruction elimination pass (#1595) * Add dead instruction elimination pass * Enable the pass * chore(ssa refactor): simple mut test * chore(ssa refactor): fixup and add doc comments * chore(ssa refactor): post merge fix --------- Co-authored-by: Joss <joss@aztecprotocol.com> * chore(brillig): Update acvm dependency (#1653) chore: update acvm dep * refactor: remove unused assign --------- Co-authored-by: joss-aztec <94053499+joss-aztec@users.noreply.github.com> Co-authored-by: jfecher <jake@aztecprotocol.com> Co-authored-by: kevaundray <kevtheappdev@gmail.com> Co-authored-by: Blaine Bublitz <blaine.bublitz@gmail.com> Co-authored-by: Joss <joss@aztecprotocol.com>
- Loading branch information
1 parent
f7f2647
commit 2893855
Showing
89 changed files
with
1,214 additions
and
137 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/assert/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
crates/nargo_cli/tests/test_data_ssa_refactor/assert/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 = "1" |
3 changes: 3 additions & 0 deletions
3
crates/nargo_cli/tests/test_data_ssa_refactor/assert/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,3 @@ | ||
fn main(x: Field) { | ||
assert(x == 1); | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/bit_and/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
2 changes: 2 additions & 0 deletions
2
crates/nargo_cli/tests/test_data_ssa_refactor/bit_and/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 @@ | ||
x = "0x00" | ||
y = "0x10" |
18 changes: 18 additions & 0 deletions
18
crates/nargo_cli/tests/test_data_ssa_refactor/bit_and/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,18 @@ | ||
// You can only do bit operations with integers. | ||
// (Kobi/Daira/Circom/#37) https://github.com/iden3/circom/issues/37 | ||
fn main(x : Field, y : Field) { | ||
let x_as_u8 = x as u8; | ||
let y_as_u8 = y as u8; | ||
|
||
assert((x_as_u8 & y_as_u8) == x_as_u8); | ||
|
||
//bitwise and with 1 bit: | ||
let flag = (x == 0) & (y == 16); | ||
assert(flag); | ||
|
||
//bitwise and with odd bits: | ||
let x_as_u11 = x as u11; | ||
let y_as_u11 = y as u11; | ||
assert((x_as_u11 & y_as_u11) == x_as_u11); | ||
} | ||
|
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/bit_shifts_comptime/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
crates/nargo_cli/tests/test_data_ssa_refactor/bit_shifts_comptime/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 = 64 |
13 changes: 13 additions & 0 deletions
13
crates/nargo_cli/tests/test_data_ssa_refactor/bit_shifts_comptime/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,13 @@ | ||
fn main(x: u64) { | ||
let two: u64 = 2; | ||
let three: u64 = 3; | ||
|
||
// comptime shifts on comptime values | ||
assert(two << 2 == 8); | ||
assert((two << 3) / 8 == two); | ||
assert((three >> 1) == 1); | ||
|
||
// comptime shifts on runtime values | ||
assert(x << 1 == 128); | ||
assert(x >> 2 == 16); | ||
} |
7 changes: 7 additions & 0 deletions
7
crates/nargo_cli/tests/test_data_ssa_refactor/bool_not/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] | ||
|
1 change: 1 addition & 0 deletions
1
crates/nargo_cli/tests/test_data_ssa_refactor/bool_not/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 = "1" |
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/bool_not/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 @@ | ||
use dep::std; | ||
fn main(x: u1) { | ||
assert(!x == 0); | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
crates/nargo_cli/tests/test_data_ssa_refactor/bool_or/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] | ||
|
2 changes: 2 additions & 0 deletions
2
crates/nargo_cli/tests/test_data_ssa_refactor/bool_or/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 @@ | ||
x = "1" | ||
y = "0" |
7 changes: 7 additions & 0 deletions
7
crates/nargo_cli/tests/test_data_ssa_refactor/bool_or/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,7 @@ | ||
use dep::std; | ||
fn main(x: u1, y: u1) { | ||
assert(x | y == 1); | ||
|
||
assert(x | y | x == 1); | ||
} | ||
|
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
crates/nargo_cli/tests/test_data_ssa_refactor/cast_bool/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] | ||
|
2 changes: 2 additions & 0 deletions
2
crates/nargo_cli/tests/test_data_ssa_refactor/cast_bool/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 @@ | ||
x = "10" | ||
y = "10" |
6 changes: 6 additions & 0 deletions
6
crates/nargo_cli/tests/test_data_ssa_refactor/cast_bool/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,6 @@ | ||
fn main(x: Field, y: Field) { | ||
let z = x == y; | ||
let t = z as u8; | ||
assert(t == 1); | ||
} | ||
|
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/comptime_array_access/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
crates/nargo_cli/tests/test_data_ssa_refactor/comptime_array_access/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 @@ | ||
a = [1, 2, 3] |
17 changes: 17 additions & 0 deletions
17
crates/nargo_cli/tests/test_data_ssa_refactor/comptime_array_access/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,17 @@ | ||
fn main(a: [Field; 3]) { | ||
let i = 1; | ||
|
||
// Using a comptime variable as a parameter should not make it non-comptime | ||
let ii = foo(i); | ||
let elem1 = a[i]; | ||
|
||
// Nor should using it in an expression with a non-comptime variable. | ||
let two = i + ii; | ||
assert(i == ii); | ||
|
||
let elem2 = a[i]; | ||
assert(elem1 == elem2); | ||
assert(two == 2); | ||
} | ||
|
||
fn foo(x: Field) -> Field { x } |
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/comptime_recursion_regression/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
2 changes: 2 additions & 0 deletions
2
crates/nargo_cli/tests/test_data_ssa_refactor/comptime_recursion_regression/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 @@ | ||
x = 5 | ||
y = 6 |
4 changes: 4 additions & 0 deletions
4
crates/nargo_cli/tests/test_data_ssa_refactor/comptime_recursion_regression/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,4 @@ | ||
fn main(x: Field, y: Field) { | ||
let flag = (x == 1) | (y == 2); | ||
assert(flag | false == flag); | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/contracts/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
2 changes: 2 additions & 0 deletions
2
crates/nargo_cli/tests/test_data_ssa_refactor/contracts/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 @@ | ||
x = 3 | ||
y = 2 |
8 changes: 8 additions & 0 deletions
8
crates/nargo_cli/tests/test_data_ssa_refactor/contracts/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,8 @@ | ||
fn main(x : Field, y : pub Field) { | ||
assert(x * 2 == y * 3); | ||
} | ||
|
||
contract Foo { | ||
fn double(x: Field) -> pub Field { x * 2 } | ||
fn triple(x: Field) -> pub Field { x * 3 } | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/hash_to_field/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
crates/nargo_cli/tests/test_data_ssa_refactor/hash_to_field/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 @@ | ||
input = "1" |
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/hash_to_field/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 @@ | ||
use dep::std; | ||
|
||
fn main(input : Field) -> pub Field { | ||
std::hash::hash_to_field([input]) | ||
} |
6 changes: 6 additions & 0 deletions
6
crates/nargo_cli/tests/test_data_ssa_refactor/main_bool_arg/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] | ||
|
2 changes: 2 additions & 0 deletions
2
crates/nargo_cli/tests/test_data_ssa_refactor/main_bool_arg/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 @@ | ||
x = true | ||
y = [true, false] |
8 changes: 8 additions & 0 deletions
8
crates/nargo_cli/tests/test_data_ssa_refactor/main_bool_arg/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,8 @@ | ||
fn main(x : bool, y: [bool;2]) { | ||
if x { | ||
assert(1 != 2); | ||
} | ||
|
||
assert(x); | ||
assert(y[0] != y[1]); | ||
} |
6 changes: 6 additions & 0 deletions
6
crates/nargo_cli/tests/test_data_ssa_refactor/main_return/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] | ||
|
1 change: 1 addition & 0 deletions
1
crates/nargo_cli/tests/test_data_ssa_refactor/main_return/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 = "8" |
3 changes: 3 additions & 0 deletions
3
crates/nargo_cli/tests/test_data_ssa_refactor/main_return/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,3 @@ | ||
fn main(x: pub Field) -> pub Field { | ||
x | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/modules/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
2 changes: 2 additions & 0 deletions
2
crates/nargo_cli/tests/test_data_ssa_refactor/modules/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 @@ | ||
x = "2" | ||
y = "13" |
3 changes: 3 additions & 0 deletions
3
crates/nargo_cli/tests/test_data_ssa_refactor/modules/src/foo.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,3 @@ | ||
fn hello(x : Field) -> Field { | ||
x | ||
} |
14 changes: 14 additions & 0 deletions
14
crates/nargo_cli/tests/test_data_ssa_refactor/modules/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,14 @@ | ||
mod foo; | ||
// This is a comment. | ||
// | ||
// `main` is the entry point to a binary | ||
// | ||
// You can have a `Binary` or a `Library` | ||
// Release : 0.2 | ||
// | ||
// To run a proof on the command line, type `cargo run prove {proof_name}` | ||
// | ||
// To verify that proof, type `cargo run verify {proof_name}` | ||
fn main(x: Field, y: pub Field) { | ||
assert(x != foo::hello(y)); | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/modules_more/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] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
Oops, something went wrong.