| 1 | comptime { |
| 2 | const undef: i64 = undefined; |
| 3 | const not_undef: i64 = 32; |
| 4 | |
| 5 | // If either of the operands are zero, then the other operand is returned. |
| 6 | @compileLog(undef +% 0); |
| 7 | @compileLog(not_undef +% 0); |
| 8 | @compileLog(0 +% undef); |
| 9 | @compileLog(0 +% not_undef); |
| 10 | // If either of the operands are undefined, the result is undefined. |
| 11 | @compileLog(undef +% 1); |
| 12 | @compileLog(not_undef +% 1); |
| 13 | @compileLog(1 +% undef); |
| 14 | @compileLog(1 +% not_undef); |
| 15 | } |
| 16 | |
| 17 | // error |
| 18 | // |
| 19 | // :6:5: error: found compile log statement |
| 20 | // |
| 21 | // Compile Log Output: |
| 22 | // @as(i64, undefined) |
| 23 | // @as(i64, 32) |
| 24 | // @as(i64, undefined) |
| 25 | // @as(i64, 32) |
| 26 | // @as(i64, undefined) |
| 27 | // @as(i64, 33) |
| 28 | // @as(i64, undefined) |
| 29 | // @as(i64, 33) |