leo/tests/compiler/integers/i128/ternary.leo

30 lines
435 B
Plaintext
Raw Normal View History

2021-05-10 20:19:19 +03:00
/*
namespace: Compile
expectation: Pass
inputs:
- i128.in: |
[main]
s: bool = true;
a: i128 = 10;
b: i128 = 5;
c: i128 = 10;
2020-07-31 02:20:31 +03:00
2021-05-10 20:19:19 +03:00
[registers]
r0: bool = false;
- i128_rev.in: |
[main]
s: bool = false;
a: i128 = 10;
b: i128 = 5;
c: i128 = 5;
[registers]
r0: bool = false;
*/
function main(s: bool, a: i128, b: i128, c: i128) -> bool {
let r = s ? a : b;
return r == c;
}