leo/tests/compiler/integers/u8/ternary.leo

30 lines
408 B
Plaintext
Raw Normal View History

2021-05-10 21:11:31 +03:00
/*
namespace: Compile
expectation: Pass
inputs:
- u8_t.in: |
[main]
s: bool = true;
a: u8 = 4;
b: u8 = 2;
c: u8 = 4;
2020-07-31 01:41:03 +03:00
2021-05-10 21:11:31 +03:00
[registers]
r0: bool = true;
- u8_f.in: |
[main]
s: bool = false;
a: u8 = 4;
b: u8 = 2;
c: u8 = 2;
[registers]
r0: bool = true;
*/
function main(s: bool, a: u8, b: u8, c: u8) -> bool {
let r = s ? a : b;
return r == c;
}