2021-05-05 11:37:51 +03:00
|
|
|
/*
|
|
|
|
namespace: Compile
|
|
|
|
expectation: Pass
|
|
|
|
inputs:
|
|
|
|
- inline.in: |
|
|
|
|
[main]
|
|
|
|
x: u32 = 10;
|
|
|
|
|
|
|
|
[registers]
|
|
|
|
r0: bool = false;
|
|
|
|
*/
|
|
|
|
|
2020-07-04 08:44:09 +03:00
|
|
|
circuit Foo {
|
|
|
|
x: u32,
|
|
|
|
|
2020-12-01 19:54:51 +03:00
|
|
|
function add_x(self, y: u32) -> u32 {
|
2021-04-14 23:59:07 +03:00
|
|
|
return self.x + y;
|
2020-07-04 08:44:09 +03:00
|
|
|
}
|
|
|
|
|
2020-12-01 19:54:51 +03:00
|
|
|
function call_add_x(self, y: u32) -> u32 {
|
2021-04-14 23:59:07 +03:00
|
|
|
return self.add_x(y);
|
2020-07-04 08:44:09 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-05 11:37:51 +03:00
|
|
|
function main(x: u32) -> bool {
|
2021-05-06 14:27:42 +03:00
|
|
|
let a = Foo { x };
|
|
|
|
let b = a.add_x(1u32);
|
2020-07-04 08:44:09 +03:00
|
|
|
|
2021-05-05 11:37:51 +03:00
|
|
|
return b == x + 1;
|
2020-07-04 08:44:09 +03:00
|
|
|
}
|