2021-07-16 13:20:36 +03:00
|
|
|
/*
|
|
|
|
namespace: Compile
|
|
|
|
expectation: Pass
|
|
|
|
input_file: inputs/dummy.in
|
|
|
|
*/
|
|
|
|
|
2021-03-27 00:02:59 +03:00
|
|
|
circuit Foo {
|
2021-04-29 22:22:17 +03:00
|
|
|
f: u8;
|
|
|
|
y: (u8, u8);
|
2021-04-10 05:52:14 +03:00
|
|
|
|
|
|
|
function z (mut self) -> u16 {
|
|
|
|
self.y.0 += 1u8;
|
2021-04-14 23:59:07 +03:00
|
|
|
return 1u16;
|
2021-04-10 05:52:14 +03:00
|
|
|
}
|
2021-03-27 00:02:59 +03:00
|
|
|
}
|
2021-07-16 13:20:36 +03:00
|
|
|
|
|
|
|
function main(k: bool) -> bool {
|
2021-03-26 08:52:58 +03:00
|
|
|
let x = 10u32;
|
2021-03-17 21:33:04 +03:00
|
|
|
x += 20;
|
2021-03-26 23:51:03 +03:00
|
|
|
|
2021-06-26 10:00:09 +03:00
|
|
|
let w = 3u32;
|
|
|
|
w += x;
|
|
|
|
|
2021-06-30 06:55:48 +03:00
|
|
|
let y = [1u8, 2u8, 3, 4];
|
2021-03-26 23:51:03 +03:00
|
|
|
y[0] += 3u8;
|
2021-06-30 06:55:48 +03:00
|
|
|
y[0..3][1] *= 3;
|
2021-03-26 23:51:03 +03:00
|
|
|
|
|
|
|
let z = (1u8, 2u8);
|
|
|
|
z.1 += 3u8;
|
2021-03-27 00:02:59 +03:00
|
|
|
|
2021-04-10 05:52:14 +03:00
|
|
|
let foo = Foo { f: 6u8, y: (1u8, 1u8) };
|
2021-03-31 21:59:45 +03:00
|
|
|
foo.f += 2u8;
|
2021-04-12 23:21:44 +03:00
|
|
|
|
|
|
|
let complex = 2u8;
|
|
|
|
complex += 22u8 - 2u8+ 1u8;
|
2021-04-10 05:52:14 +03:00
|
|
|
let a = [[0u8; 1]; 4];
|
|
|
|
a[2][0] += 1u8;
|
2021-04-12 18:47:19 +03:00
|
|
|
|
|
|
|
let b = [0u8; (4, 1)];
|
|
|
|
b[2][0] += 1u8;
|
2021-07-16 13:20:36 +03:00
|
|
|
|
|
|
|
return x == 30u32 && w == 33u32 && y[0] == 4u8 && y[1] == 6u8
|
|
|
|
&& z.1 == 5u8 && foo.f == 8u8 && a[2][0] == 1u8 && a[2][0] == 1u8
|
|
|
|
&& k;
|
2021-03-17 21:33:04 +03:00
|
|
|
}
|