-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from noir-lang/gd/ssa_arrays
Gd/ssa arrays
- Loading branch information
Showing
29 changed files
with
1,562 additions
and
418 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// Test unsafe integer arithmetic | ||
// minimal failing test ...to debug! | ||
|
||
fn main(x : u32, y : u32) { | ||
x = x * x; | ||
|
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] |
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 @@ | ||
x = [104, 101, 108, 108, 111] | ||
y = [10, 81, 18, 48, 0] | ||
z = "59" | ||
t = "10" | ||
|
||
#7128 | ||
#15309 | ||
#16349 | ||
|
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 @@ | ||
setpub = [] |
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,44 @@ | ||
//Basic tests for arrays | ||
|
||
fn main(x : [5]u32 , y : [5]u32 , z : u32, t : u32) { | ||
let c = 2301 as u32; | ||
//t= t+x[0]-x[0]; | ||
z=y[4]; | ||
//Test 1: | ||
for i in 0..5 { | ||
c = z*z*y[i]; | ||
z = z - c; | ||
}; | ||
constrain (z==0); //y[4]=0, so c and z are always 0 | ||
|
||
//Test 2: | ||
c = 2301 as u32; | ||
for i in 0..5 { | ||
c = t+2; | ||
c = z*z*x[i]; | ||
z = z + x[i]*y[i] - c; | ||
}; | ||
constrain (z==3814912846); | ||
|
||
//Test 3: | ||
c = 2300001 as u32; | ||
z=y[4]; | ||
for i in 0..5 { | ||
z = z + x[i]*y[i]; | ||
for _i in 0..3 { | ||
c = i as u32 - 2 as u32; | ||
z=c*z; | ||
}; | ||
}; | ||
constrain (z==41472); | ||
|
||
//Test 4: | ||
z=y[4]; | ||
for i in 0..3 { | ||
z = z + x[i]*y[i]; | ||
for j in 0..2 { | ||
z = z + x[i+j]-y[i+j]; | ||
}; | ||
}; | ||
constrain (z ==11539); | ||
} |
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,6 @@ | ||
|
||
# List of tests to be excluded (i.e not run), as their directory name in test_data | ||
exclude = [] | ||
exclude = ["6_array"] | ||
|
||
# List of tests (as their directory name in test_data) expecting to fail: if the test pass, we report an error. | ||
fail = [] |
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
Oops, something went wrong.