leo/tests/compiler/circuits/define_circuit_inside_circuit_function.leo

28 lines
353 B
Plaintext
Raw Normal View History

2021-05-05 11:37:51 +03:00
/*
namespace: Compile
expectation: Pass
inputs:
- func_circ.in: |
[main]
a: u32 = 100;
[registers]
r0: bool = false;
*/
circuit Foo {
a: u32,
}
circuit Bar {
2021-05-05 11:37:51 +03:00
function bar(a: u32) -> u32 {
2021-05-06 14:27:42 +03:00
let f = Foo { a: a };
2021-05-05 11:37:51 +03:00
return f.a;
}
}
2021-05-05 11:37:51 +03:00
function main(a: u32) -> bool {
2021-05-06 14:27:42 +03:00
let b = Bar::bar(a);
2021-05-05 11:37:51 +03:00
return a == b;
}