mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 02:31:44 +03:00
remove unused code
This commit is contained in:
parent
7bbd70423d
commit
a9992bc6d4
@ -1,12 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: inputs/index.in
|
||||
*/
|
||||
|
||||
function main (x: u32) -> bool {
|
||||
const y = [aleo1x0rh2cudq93fhukrsce8sgvcphddv4qs0clph64stpg0hstfds9qjvxcg6; 3];
|
||||
let z = y[x];
|
||||
|
||||
return z == y[0];
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file:
|
||||
- inputs/dummy.in
|
||||
*/
|
||||
|
||||
|
||||
type Int = u32;
|
||||
|
||||
circuit Int {
|
||||
x: u8;
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return y;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file:
|
||||
- inputs/dummy.in
|
||||
*/
|
||||
|
||||
type int = u32;
|
||||
|
||||
function int() {}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return y;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file:
|
||||
- inputs/dummy.in
|
||||
*/
|
||||
|
||||
type int = u32;
|
||||
|
||||
const int = 8u8;
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return y;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/basic.in
|
||||
*/
|
||||
|
||||
type int = u32;
|
||||
|
||||
function main(x: u32, y: bool) -> bool {
|
||||
let a: int = x;
|
||||
let b: int = 2;
|
||||
let c: int = a + b;
|
||||
|
||||
return a == 1u32 && b == 2u32
|
||||
&& c == 3u32 && y;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/basic.in
|
||||
*/
|
||||
|
||||
type int = u32;
|
||||
type number = int;
|
||||
|
||||
function main(x: u32, y: bool) -> bool {
|
||||
let a: int = x;
|
||||
let b: number = 2u32;
|
||||
let c: number = 3;
|
||||
let d: u32 = a + b + c;
|
||||
|
||||
return a == 1u32 && b == 2u32
|
||||
&& c == 3u32 && d == 6u32 && y;
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/basic.in
|
||||
*/
|
||||
|
||||
type int = u32;
|
||||
|
||||
circuit Foo {
|
||||
a: u32;
|
||||
}
|
||||
|
||||
circuit Bar {
|
||||
a: int;
|
||||
}
|
||||
|
||||
function main(x: u32, y: bool) -> bool {
|
||||
let a: int = x;
|
||||
let f: Foo = Foo { a };
|
||||
let b: Bar = Bar { a };
|
||||
|
||||
return a == 1u32 && f.a == 1u32
|
||||
&& b.a == 1u32 && y;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file:
|
||||
- inputs/dummy.in
|
||||
*/
|
||||
|
||||
type int = u32;
|
||||
type int = u8;
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return y;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/dummy.in
|
||||
*/
|
||||
|
||||
type int = u32;
|
||||
|
||||
function return_int_triary() -> (int, int, int) {
|
||||
return (1, 2, 3);
|
||||
}
|
||||
|
||||
function return_int_array() -> [int; 3] {
|
||||
return [0u32; 3];
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
let a: (int, int, int) = return_int_triary();
|
||||
let b: [int; 3] = return_int_array();
|
||||
|
||||
return y;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
[main]
|
||||
x: u32 = 1;
|
||||
y: bool = true;
|
||||
|
||||
[registers]
|
||||
r0: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
y: bool = true;
|
||||
|
||||
[registers]
|
||||
r0: bool = false;
|
@ -1,6 +0,0 @@
|
||||
[main]
|
||||
x: u8 = 1;
|
||||
y: bool = true;
|
||||
|
||||
[registers]
|
||||
r0: bool = false;
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/basic.in
|
||||
*/
|
||||
|
||||
type x = u32;
|
||||
|
||||
function main(x: x, y: bool) -> bool {
|
||||
return y;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/dummy.in
|
||||
*/
|
||||
|
||||
type int = u32;
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
let int: int = 1u32;
|
||||
|
||||
return y;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file:
|
||||
- inputs/wrong_type_fail.in
|
||||
*/
|
||||
|
||||
type int = u32;
|
||||
|
||||
function main(x: u8, y: bool) -> bool {
|
||||
let a: int = x;
|
||||
|
||||
return a == 1u32 && y;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/array_range_access_fail.in
|
||||
*/
|
||||
|
||||
function main (
|
||||
const x: u32
|
||||
) {
|
||||
const y = [1u8; 3];
|
||||
const z: [u8; 2] = y[..1u32][..x];
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main() {
|
||||
let a = [true; (0)];
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- input/complex_access.in
|
||||
*/
|
||||
|
||||
circuit Circ {
|
||||
f: u32
|
||||
}
|
||||
|
||||
function main (a: [u8; 8], b: u32, c: [[u8; 3]; 3], d: [(u8, u32); 1], e: [u8; (3, 4)] ) -> bool {
|
||||
a[0..3][b] = 93;
|
||||
a[2..6][1] = 87;
|
||||
a[2..6][1] *= 2;
|
||||
a[2..3] = [42u8];
|
||||
a[6..][0] = 43u8;
|
||||
a[0..1][0..1] = [200];
|
||||
|
||||
c[0..2][0] = [1u8; 3];
|
||||
c[1..][1][1..2][0] = 126;
|
||||
c[1..][0] = [42, 43, 44];
|
||||
c[Circ {f: 0}.f..1][0][0] += 2;
|
||||
|
||||
d[..1][0].1 = 1;
|
||||
|
||||
e[0..][0] = [22; 4];
|
||||
e[0..][0][0] = 33;
|
||||
|
||||
return
|
||||
a == [200u8, 93, 42, 174, 5, 6, 43, 8]
|
||||
&& c == [[3u8, 1, 1], [42, 43, 44], [7, 126, 9]]
|
||||
&& d == [(0u8, 1u32)]
|
||||
&& e == [[33u8, 22, 22, 22], [0, 0, 0, 0], [0, 0, 0, 0]];
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- input/six_zeros.in
|
||||
- input/count_to_6.in
|
||||
*/
|
||||
|
||||
function main(a: [u8; (3, 2)]) -> bool {
|
||||
return a == [0u8; (3, 2)];
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- input/six_zeros.in
|
||||
- input/count_to_6.in
|
||||
*/
|
||||
|
||||
function main(a: [u8; (3, 2)]) -> bool {
|
||||
return a == [[1u8, 2], [3, 4], [5, 6]];
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
[constants]
|
||||
x: u32 = 1u32;
|
@ -1,9 +0,0 @@
|
||||
[main]
|
||||
a: [u8; 8] = [1u8, 2, 3, 4, 5, 6, 7, 8];
|
||||
b: u32 = 1;
|
||||
c: [[u8; 3]; 3] = [[1u8, 2, 3], [4, 5, 6], [7, 8, 9]];
|
||||
d: [(u8, u32); 1] = [(0u8, 0u32)];
|
||||
e: [u8; (3, 4)] = [0u8; (3, 4)];
|
||||
|
||||
[registers]
|
||||
out: bool = true;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [[u8; 2]; 3] = [[1, 2], [3, 4], [5, 6]];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,6 +0,0 @@
|
||||
[main]
|
||||
y: bool = true;
|
||||
n: bool = false;
|
||||
|
||||
[registers]
|
||||
r0: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [0u8; (2, 2)];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [[0u8; 2]; 3];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [[0u8; 3]; 2)];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [0u8; (3, 2)];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [0u8; (2, 3)];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,8 +0,0 @@
|
||||
[main]
|
||||
a: [u8; 3] = [1, 1, 1];
|
||||
|
||||
[registers]
|
||||
r: [u8; 3] = [1u8, 1u8, 1u8];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,8 +0,0 @@
|
||||
[main]
|
||||
a: [u8; 3] = [1, 1, 1]; // doesn't match arr below
|
||||
|
||||
[registers]
|
||||
r: [u8; 3] = [0u8, 0u8, 0u8];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [0; (3, 2)];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; 3] = [1, 1, 1];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,6 +0,0 @@
|
||||
[main]
|
||||
a: [[u8; 2]; 3] = [[0; 2]; 3];
|
||||
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [[u8; 2]; 3] = [0; (3, 2)];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering)
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [[0; 2]; 3];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [0; (3, 2)];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (4, 3, 2)] = [0; (4, 3, 2)];
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,5 +0,0 @@
|
||||
[main]
|
||||
a: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering)
|
||||
|
||||
[registers]
|
||||
x: bool = false;
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/input_nested_3x2.in
|
||||
*/
|
||||
|
||||
function main(a: [u8; (3, 2)]) -> bool {
|
||||
return a == [[0u8; 2]; 3];
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/input_nested_3x2_fail.in
|
||||
*/
|
||||
|
||||
function main(a: [u8; (3, 2)]) -> bool {
|
||||
return a == [[0u8; 2]; 3)]; // This should be written the right way as this test is for the input file.
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/input_tuple_3x2.in
|
||||
*/
|
||||
|
||||
function main(a: [u8; (3, 2)]) -> bool {
|
||||
return a == [0u8; (3, 2)];
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/input_tuple_3x2_fail.in
|
||||
*/
|
||||
|
||||
function main(a: [u8; (3, 2)]) -> bool {
|
||||
return a == [0u8; (3, 2)];
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main() -> bool {
|
||||
const arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions
|
||||
return false;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main() -> bool {
|
||||
const arr: [u8; (2, 2)] = [[1u8, 1u8],
|
||||
[1u8]]; // incorrect dimensions
|
||||
return false;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
const a: [u8; (2, 2, 2)] = [1u8; (2, 2, 2)];
|
||||
const b: [u8; (2, 2, 2)] = [[[1u8; 2]; 2]; 2];
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main() -> bool {
|
||||
const arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions
|
||||
return false;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(n: bool) -> bool {
|
||||
const x = [false; (2, 2)];
|
||||
const z: bool = x[0][0];
|
||||
|
||||
return n == z;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
// Multidimensional array syntax in leo
|
||||
function main(y: bool) -> bool {
|
||||
const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline
|
||||
const b: [u32; (3, 2)] = [[0; 2]; 3]; // initializer
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
|
||||
// Multidimensional array syntax in leo
|
||||
function main(y: bool) -> bool {
|
||||
const a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)
|
||||
return false;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- input/registers_ones.in
|
||||
- input/registers_zeros.in
|
||||
*/
|
||||
|
||||
function main(a: [u8; 3]) -> [u8; 3] {
|
||||
return input.registers.r == a ? [3,2,1] : [1,2,3];
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/three_ones.in
|
||||
*/
|
||||
|
||||
// `{from}..{to}` copies the elements of one array into another exclusively
|
||||
function main(a: [u8; 3]) -> bool {
|
||||
const b = [1u8; 4];
|
||||
return a == b[0..3];
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
const arr: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
||||
const expected: [u32; 2] = [0, 1];
|
||||
|
||||
const actual = arr[..2]; // Should produce [0, 1]
|
||||
|
||||
return (expected == actual) == y;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/three_ones.in
|
||||
*/
|
||||
|
||||
// A spread operator `...` copies the elements of one array into another
|
||||
function main(a: [u8; 3]) -> bool {
|
||||
const b = [1u8, 1u8];
|
||||
const c = [1u8, ...b];
|
||||
const d = [...b, 1u8];
|
||||
|
||||
return a == c && d == a;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/three_ones.in
|
||||
*/
|
||||
|
||||
function main (a: [u8; 3]) -> bool {
|
||||
let y = a[0..[0u8; 2] == [0u8; 2]? 2u8 : 2u8];
|
||||
return y == [1u8, 1];
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
// Multidimensional array syntax in leo
|
||||
function main(y: bool) -> bool {
|
||||
const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline
|
||||
const b: [u32; (3, 2)] = [0; (3, 2)]; // initializer
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
// Multidimensional array syntax in leo
|
||||
function main() {
|
||||
const a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const a: [u8; -2] = [0u32; 2];
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/input_tuple_3x2.in
|
||||
*/
|
||||
|
||||
function main(a: [[u8; 2]; 3]) -> bool {
|
||||
const b = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline
|
||||
|
||||
return a == b;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/type_tuple_value_nested_4x3x2.in
|
||||
*/
|
||||
|
||||
function main(a: [[[u8; 2]; 3]; 4]) -> bool {
|
||||
const b = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline
|
||||
|
||||
return a == b;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/type_nested_value_nested_3x2.in
|
||||
*/
|
||||
|
||||
function main(a: [[u8; 2]; 3]) -> bool {
|
||||
const c = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline
|
||||
const b: [[u8; 2]; 3] = [[0; 2]; 3]; // initializer
|
||||
|
||||
return b == a && a == c;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline
|
||||
|
||||
const b: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4]; // initializer
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline
|
||||
const b: [[u8; 2]; 3] = [0; (3, 2)]; // initializer
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline
|
||||
|
||||
const b: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)]; // initializer
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering)
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline
|
||||
|
||||
const b: [u8; (3, 2)] = [[0; 2]; 3]; // initializer
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering)
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline
|
||||
|
||||
const b: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4]; // initializer
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline
|
||||
|
||||
const b: [u8; (3, 2)] = [0; (3, 2)]; // initializer
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering)
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
function main(y: bool) -> bool{
|
||||
const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]],
|
||||
[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline
|
||||
|
||||
const b: [u8; (4, 3, 2)] = [0; (4, 3, 2)]; // initializer
|
||||
|
||||
return (a == b) == y;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order)
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const a = [1u8; 10];
|
||||
for i in 0..10 {
|
||||
const x = a[i..10];
|
||||
console.debug("{}", x);
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/ascii.in
|
||||
- inputs/escaped_unicode1.in
|
||||
- inputs/escaped_unicode2.in
|
||||
- inputs/escaped_unicode3.in
|
||||
- inputs/escaped_unicode4.in
|
||||
- inputs/escaped_unicode5.in
|
||||
- inputs/escaped_unicode6.in
|
||||
- inputs/escaped.in
|
||||
- inputs/hex1.in
|
||||
- inputs/hex2.in
|
||||
- inputs/unicode1.in
|
||||
- inputs/unicode2.in
|
||||
- inputs/unicode3.in
|
||||
- inputs/unicode4.in
|
||||
- inputs/unicode5.in
|
||||
*/
|
||||
|
||||
circuit Foo {
|
||||
character: char;
|
||||
}
|
||||
|
||||
function main(character: char) -> char {
|
||||
let f = Foo { character };
|
||||
|
||||
let character2 = f.character == 'a' ? 'a' : f.character;
|
||||
return character2;
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/nonprinting.in
|
||||
*/
|
||||
function main(
|
||||
in1: char,
|
||||
in2: char,
|
||||
in3: char,
|
||||
in4: char,
|
||||
in5: char,
|
||||
in6: char,
|
||||
in7: char,
|
||||
in8: char,
|
||||
in9: char,
|
||||
in10: char,
|
||||
in11: char,
|
||||
in12: char,
|
||||
in13: char,
|
||||
in14: char,
|
||||
in15: char,
|
||||
in16: char,
|
||||
in17: char,
|
||||
in18: char,
|
||||
in19: char,
|
||||
in20: char,
|
||||
in21: char,
|
||||
in22: char,
|
||||
in23: char,
|
||||
in24: char,
|
||||
in25: char,
|
||||
in26: char,
|
||||
in27: char,
|
||||
in28: char,
|
||||
in29: char,
|
||||
in30: char,
|
||||
in31: char,
|
||||
in32: char,
|
||||
in33: char,
|
||||
) -> ([char; 33], bool) {
|
||||
let str = [
|
||||
in1,
|
||||
in2,
|
||||
in3,
|
||||
in4,
|
||||
in5,
|
||||
in6,
|
||||
in7,
|
||||
in8,
|
||||
in9,
|
||||
in10,
|
||||
in11,
|
||||
in12,
|
||||
in13,
|
||||
in14,
|
||||
in15,
|
||||
in16,
|
||||
in17,
|
||||
in18,
|
||||
in19,
|
||||
in20,
|
||||
in21,
|
||||
in22,
|
||||
in23,
|
||||
in24,
|
||||
in25,
|
||||
in26,
|
||||
in27,
|
||||
in28,
|
||||
in29,
|
||||
in30,
|
||||
in31,
|
||||
in32,
|
||||
in33,
|
||||
];
|
||||
console.log("{}", str);
|
||||
return (str, in1 == '\x00');
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
[registers]
|
||||
r: char = 'a';
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
circuit Foo {
|
||||
x: u32;
|
||||
|
||||
function new() -> Self {
|
||||
let new: Self = Self {
|
||||
x: 1u32
|
||||
};
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
function etc() {
|
||||
let y = [0u32, 1, 2, 3];
|
||||
y[Self {x: 0}.x] += 2;
|
||||
}
|
||||
|
||||
function func(a: [Self; 3], y: (Self)) {
|
||||
const x: Self = Foo {x: Self {x: 1}.x};
|
||||
}
|
||||
|
||||
function self_circ(x: Self) {}
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
let foo: Foo = Foo::new();
|
||||
return foo.x == 1u32 && y;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
circuit Foo {
|
||||
x: u32;
|
||||
|
||||
function new() -> Self {
|
||||
let new: Self = Self {
|
||||
x: 1u32
|
||||
};
|
||||
|
||||
return new;
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
let foo: Self = Foo::new();
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file:
|
||||
- inputs/dummy.in
|
||||
*/
|
||||
|
||||
circuit Int {
|
||||
x: u8;
|
||||
}
|
||||
|
||||
type Int = u32;
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return y;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file:
|
||||
- inputs/dummy.in
|
||||
*/
|
||||
|
||||
circuit Foo {
|
||||
x: u8;
|
||||
}
|
||||
|
||||
function Foo() {}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return y;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file:
|
||||
- inputs/dummy.in
|
||||
*/
|
||||
|
||||
circuit Foo {
|
||||
x: u8;
|
||||
}
|
||||
|
||||
const Foo = 8u8;
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
return y;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
circuit Foo {
|
||||
a: u8;
|
||||
|
||||
function use_a(const self) -> u8 {
|
||||
return self.a + 1;
|
||||
}
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
let f = Foo { a: 0u8 };
|
||||
|
||||
return (1u8 == f.use_a()) == true;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
circuit Foo {
|
||||
a: u8;
|
||||
|
||||
function set_a(const self, new: u8) {
|
||||
self.a = new;
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
let f = Foo { a: 0u8 };
|
||||
|
||||
f.set_a(1u8);
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
inputs:
|
||||
- func_circ.in: |
|
||||
[main]
|
||||
a: u32 = 100;
|
||||
|
||||
[registers]
|
||||
r0: bool = false;
|
||||
*/
|
||||
|
||||
circuit Foo {
|
||||
a: u32,
|
||||
}
|
||||
|
||||
circuit Bar {
|
||||
function bar(a: u32) -> u32 {
|
||||
let f = Foo { a: a };
|
||||
return f.a;
|
||||
}
|
||||
}
|
||||
|
||||
function main(a: u32) -> bool {
|
||||
let b = Bar::bar(a);
|
||||
return a == b;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: input/dummy.in
|
||||
*/
|
||||
|
||||
circuit Bar {
|
||||
b2: u32
|
||||
|
||||
function add_five(z: u32) -> u32 {
|
||||
return z + 5u32;
|
||||
}
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
const Bar = 66u32;
|
||||
const k1 = Bar { b2: 30u32 };
|
||||
const k2 = Bar::add_five(55u32);
|
||||
|
||||
return y == true;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
inputs:
|
||||
- inline.in: |
|
||||
[main]
|
||||
x: u32 = 100;
|
||||
|
||||
[registers]
|
||||
r0: u32 = 0;
|
||||
*/
|
||||
|
||||
circuit Foo {
|
||||
x: u32
|
||||
}
|
||||
|
||||
function main(x: u32) -> u32 {
|
||||
let a = Foo { x: x };
|
||||
return a.x;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user